# Used for social media preview cards
images = ["images/logo-wide.jpg"]
+# Disable the "copy to clipboard" button for inline code
+disableInlineCopyToClipBoard = true
+
[permalinks]
tags = "/blog/tags/:slug"
author = "/blog/author/:slug"
--- /dev/null
+---
+title: "Hello World!"
+description: "Getting started using the BDK library in a very simple Rust project"
+author: "Alekos Filini"
+date: "2020-12-18"
+tags: ["getting started", "rust"]
+hidden: true
+draft: false
+---
+
+## Introduction
+
+This article should serve as a "getting started" guide for developers who are considering integrating BDK in their own projects: it tries to introduce the reader to the basic concepts behind the library and some of its
+modules and components that can be used to build a very simple functioning Bitcoin wallet. All the informations written in this article are valid for the current `master` git branch, and should remain valid for the upcoming [`v0.2.0` release](https://github.com/bitcoindevkit/bdk/projects/1)
+which is planned to be tagged pretty soon.
+
+## Design Goals
+
+The main goal of the library is to be a solid foundation for Bitcoin wallets of any kind, on any platform: in practice this means that the library should be:
+
+- Very well reviewed and tested
+- Lightweight, so that it can be used easily on mobile devices as well
+- Extendable, so that it can be adapted to perfectly suit different use-cases
+- Generalized, meaning that it supports different types of Bitcoin scripts and wallets through the use of [descriptors][descriptor]
+- Reasonably easy to use, exposing a "high level" interface to the user and hiding all the complexity inside
+
+These goals have a direct impact on the design of the internal components of the library, and as a consequence on the APIs that are exposed to the final user, which might in some cases feel counter-intuitive at first.
+Throughout the article I will try to focus on those points and try to explain them as best as I can.
+
+## The `Wallet` Structure
+
+The [`Wallet`][wallet] structure is in many ways the heart of the library: it represents an instance of a wallet and exposes some APIs to perform all the typical operations one might want to do with a Bitcoin wallet,
+such as generating a new address, listing the transactions received, creating a transaction, etc.
+
+A `Wallet` instance can be constructed given at least one [descriptor] which would be used to derive both [`External`][KeychainKind] and [`Internal`][KeychainKind] addresses, or two if one prefers to keep them separated. `External` addresses are the
+ones returned by an explicit [`Wallet::get_new_address()`][get_new_address] call, while `Internal` addresses are generated internally to receive the change whenever a new transaction is created.
+
+A `Wallet` also needs at least one other component to function properly, its [`Database`][Database]: it will be used as a *cache* to store the list of transactions synchronized with the blockchain, the UTXOs, the addresses generated, and a few other things. It's important
+to note that the `Database` will never store any secret. Securely storing keys is explicitly left to the user of the library to implement, mainly because there isn't really one good way to do it, that would work reliably on every platform. On
+mobile devices, for instance, the OS' keychain could be used, to allow unlocking the secrets with the use of biometric data (FaceID or fingerprint), while on desktop platform there isn't generally a similar
+framework available and the user would have to implement something that meets their needs. It's not excluded that in the future we could provide a "reference implementation" of a secure multi-platform storage for keys,
+but that would very likely be released as a separate module outside of the `Wallet` structure, or potentially even as a separate library that could be reused for other applications as well.
+
+Going back to our `Wallet`: given a descriptor and a `Database` we can build an "air-gapped", or "Offline" wallet: basically a wallet that physically doesn't have the ability to connect to the Bitcoin network. It will still be able to generate addresses and
+sign [PSBTs][PSBT], but with a greatly reduced attack surface because a sizable part of the code that handles the logic to synchronize with the network would be entirely omitted in the final executable binary.
+
+This is how an `OfflineWallet` can be created. Notice that we are using [`MemoryDatabase`][MemoryDatabase] as our `Database`. We'll get to that in a second.
+
+```rust
+use bdk::{Wallet, OfflineWallet};
+use bdk::database::MemoryDatabase;
+use bdk::bitcoin::Network;
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let external_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/0/*)";
+ let internal_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/1/*)";
+
+ let wallet: OfflineWallet<_> = Wallet::new_offline(
+ external_descriptor,
+ Some(internal_descriptor),
+ Network::Testnet,
+ MemoryDatabase::new(),
+ )?;
+
+ Ok(())
+}
+```
+
+Once we have our `Wallet` instance we can generate a new address and print it out:
+
+```rust
+// ...
+
+println!("Generated Address: {}", wallet.get_new_address()?);
+```
+
+Building and running this code will print out:
+
+```text
+Generated Address: tb1q7w0t936xp5p994qx506xj53gjdcmzjr2mkqghn
+```
+
+Before we've talked about the benefits of air-gapped wallet, but we should also talk about the disadvantages: the biggest one is the fact that it cannot create new transactions because
+it doesn't know which UTXOs belong to the wallet. To get this information we generally need to `sync` with the network, but this wallet can't physically do that.
+
+To fix this we can add one more component to our `Wallet`: a [`Blockchain`][Blockchain] backend. In particular we are going to use the [`ElectrumBlockchain`][ElectrumBlockchain] which syncs with an `Electrum` server,
+since that's available out of the box in BDK and is pretty fast.
+
+We can change our `Wallet` construction to look something like this:
+
+```rust
+use bdk::blockchain::ElectrumBlockchain;
+use bdk::electrum_client::Client;
+
+// ...
+
+let wallet = Wallet::new(
+ external_descriptor,
+ Some(internal_descriptor),
+ Network::Testnet,
+ MemoryDatabase::new(),
+ ElectrumBlockchain::from(Client::new("ssl://electrum.blockstream.info:60002").unwrap()),
+)?;
+```
+
+This piece of code is very similar to the one we wrote before, but this time we are using the [`Wallet::new()`][Wallet_new] constructor instead of [`Wallet::new_offline()`][Wallet_new_offline], and this takes an extra argument for the `Blockchain` type to use.
+Specifically here, we create an `ElectrumBlockchain` and connect to Blockstream's public Electrum Testnet servers over SSL.
+
+Now, since we are running in the `Testnet` network, we can try to get some funds from a faucet online to this address we've generated. Once we have an incoming transaction we can do the first `sync` of our *online* wallet.
+this is again something that might seem counterintuitve at first: why do we have to manually ask the `Wallet` to *sync* itself? Can't it do it periodically in background? The answer is that yes, that would definitely be possible,
+but it would remove some control on what's happening inside the wallet from the user. This can be especially problematic on mobile platforms, where the OS tries very aggressively to suspend apps in background to save
+battery. Having a thread running and trying to make network requests while the app is in background would very likely cause errors or potentially crashes somewhere. So for this reason this operation has to be performed manually,
+to allow the user to call that function only at the right time.
+
+```rust
+use bdk::blockchain::noop_progress;
+
+// ...
+
+wallet.sync(noop_progress(), None)?;
+```
+
+In this case we are not interested in receiving updates about the progress, and we just want to use the default settings, so we use [`noop_progress()`][noop_progress] and `None` as arguments. This will make queries to the Electrum server
+and store the list of transactions and UTXOs in our `Database`. In this case, we are using a `MemoryDatabase`, so those information are only going to be kept in RAM and dropped once our `Wallet` is dropped. This is very useful
+for playing around and experimenting, but not so great for real world wallets: for that, you can use [sled][sled] which is supported out of the box or even use a custom database. More on that later!
+
+So now that we've synced with the blockchain we can create our first transaction. First of all, we will print out the balance of our wallet to make sure that our wallet has seen the incoming transaction. Then we
+will create the actual transaction and we will specify some flags using the [`TxBuilder`][TxBuilder]. To finish it off, we will ask the wallet to sign the transaction and then broadcast it to the network.
+
+Right now we will not get into details of all the available options in `TxBuilder` since that is definitely out of scope of a "getting started" guide. For now you can just imagine the builder as your way to tell the library
+how to build transactions. We'll come back to this in a future article.
+
+```rust
+use std::str::FromStr;
+
+use bdk::bitcoin::Address;
+use bdk::TxBuilder;
+
+// ...
+
+let balance = wallet.get_balance()?;
+println!("Wallet balance in SAT: {}", balance);
+
+let faucet_address = Address::from_str("mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt")?;
+let (unsigned_psbt, tx_details) = wallet.create_tx(
+ TxBuilder::with_recipients(vec![(faucet_address.script_pubkey(), balance / 2)])
+ .enable_rbf(),
+)?;
+println!("Transaction details: {:#?}", tx_details);
+```
+
+In this case we are sending back half the balance to the faucet's address and we are also enabling RBF, since the default fees are at 1 satoshi/vbyte. With RBF we will be able to *bump the fees* of the transaction, should it get
+stuck in the mempool due to the low fee rate.
+
+All that's left to do once we have our unsigned PSBT is to sign it:
+
+```rust
+// ...
+
+let (signed_psbt, tx_finalized) = wallet.sign(unsigned_psbt, None)?;
+assert!(tx_finalized, "Tx has not been finalized");
+```
+
+And then broadcast it:
+
+```rust
+// ...
+
+let raw_transaction = signed_psbt.extract_tx();
+let txid = wallet.broadcast(raw_transaction)?;
+println!(
+ "Transaction sent! TXID: {txid}.\nExplorer URL: https://blockstream.info/testnet/tx/{txid}",
+ txid = txid
+);
+```
+
+## Custom Database and Blockchain types
+
+We briefly mentioned before that for our example we used the `MemoryDatabase`, but that it could also be swapped for a different one: this is one example of the *modularity* of BDK. By default some database
+types are implemented in the library, namely (as of now) the `MemoryDatabase` which only keeps data in RAM and the [sled][sled] database that can store data on a filesystem. But since the `Database` trait is public,
+users of the library can also implement different database types more suitable for their use-case.
+
+The same is true for the `Blockchain` types: the library provides (through the use of opt-in features) an implementation for the `Electrum`, `Esplora` and `CompactFilters` (*Neutrino*) backends. Those again can also be
+swapped with custom types if the user desires to do so.
+
+## Conclusion
+
+Hopefully this article will help you get started with BDK! This is just a very quick and gentle introduction to the library, and only barely scratches the surface of what's inside: we will keep publishing more
+articles in the future to explain some of the more advanced features of BDK, like key generation, using complex [descriptors][descriptor] with multiple keys and/or timelocks, using external signers, etc.
+
+If you'd like to learn more about the library feel free to ask any questions in the comment section down below, or join our [Discord Community](https://discord.gg/d7NkDKm) to chat with us directly!
+
+
+[descriptor]: /descriptors
+[PSBT]: https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
+[sled]: https://docs.rs/sled/
+
+[Wallet]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/wallet/struct.Wallet.html
+[KeychainKind]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/enum.KeychainKind.html
+[get_new_address]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/wallet/struct.Wallet.html#method.get_new_address
+[Database]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/database/trait.Database.html
+[MemoryDatabase]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/database/memory/struct.MemoryDatabase.html
+[Blockchain]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/blockchain/trait.Blockchain.html
+[ElectrumBlockchain]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/blockchain/electrum/struct.ElectrumBlockchain.html
+[Wallet_new]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/wallet/struct.Wallet.html#method.new
+[Wallet_new_offline]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/wallet/struct.Wallet.html#method.new_offline
+[noop_progress]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/blockchain/fn.noop_progress.html
+[TxBuilder]: /docs-rs/bdk/nightly/b8c6732c74bf7d4558a85d39a9e423347acf5ea0/bdk/wallet/tx_builder/struct.TxBuilder.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
+ body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod){border-bottom-color:#5c6773;}h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}code{color:#ffb454;}h3>code,h4>code,h5>code{color:#e6e1cf;}pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 transparent;}.sidebar{scrollbar-color:#5c6773 transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#5c6773;}.docblock table,.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.content .highlighted{color:#000 !important;background-color:#c6afb3;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted{background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a span.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#c5c5c5;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#39AFD7;}.collapse-toggle{color:#999;}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.search-focus:disabled{color:#929292;}.module-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background-color:transparent;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help>div>span{border-bottom-color:#5c6773;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label{color:#999;}:target>code,:target>.in-band{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}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,.4);}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:#39AFD7;}.tooltip .tooltiptext{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip .tooltiptext::after{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.content .highlighted.mod,.content .highlighted.externcrate{}.search-input:focus{}.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{}.content .highlighted.trait{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content .highlighted.traitalias{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}.content .highlighted.foreigntype{}pre.rust .lifetime{}.content .highlighted.primitive{}.content .highlighted.constant,.content .highlighted.static{}.stab.unstable{}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content .highlighted.enum{}.content .highlighted.struct{}.content .highlighted.keyword{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.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{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{}.stab.portability{}.content .highlighted.union{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}.content .highlighted.type{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,.help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results td span.alias{color:#c5c5c5;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;}
\ 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate bdk</p><div class="block version"><p>Version 0.1.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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.BitcoinPeerConfig.html">blockchain::compact_filters::BitcoinPeerConfig</a></li><li><a href="blockchain/compact_filters/struct.CompactFiltersBlockchain.html">blockchain::compact_filters::CompactFiltersBlockchain</a></li><li><a href="blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html">blockchain::compact_filters::CompactFiltersBlockchainConfig</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/electrum/struct.ElectrumBlockchainConfig.html">blockchain::electrum::ElectrumBlockchainConfig</a></li><li><a href="blockchain/esplora/struct.EsploraBlockchain.html">blockchain::esplora::EsploraBlockchain</a></li><li><a href="blockchain/esplora/struct.EsploraBlockchainConfig.html">blockchain::esplora::EsploraBlockchainConfig</a></li><li><a href="database/any/struct.SledDbConfiguration.html">database::any::SledDbConfiguration</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="descriptor/template/struct.BIP44.html">descriptor::template::BIP44</a></li><li><a href="descriptor/template/struct.BIP44Public.html">descriptor::template::BIP44Public</a></li><li><a href="descriptor/template/struct.BIP49.html">descriptor::template::BIP49</a></li><li><a href="descriptor/template/struct.BIP49Public.html">descriptor::template::BIP49Public</a></li><li><a href="descriptor/template/struct.BIP84.html">descriptor::template::BIP84</a></li><li><a href="descriptor/template/struct.BIP84Public.html">descriptor::template::BIP84Public</a></li><li><a href="descriptor/template/struct.P2PKH.html">descriptor::template::P2PKH</a></li><li><a href="descriptor/template/struct.P2WPKH.html">descriptor::template::P2WPKH</a></li><li><a href="descriptor/template/struct.P2WPKH_P2SH.html">descriptor::template::P2WPKH_P2SH</a></li><li><a href="keys/struct.DescriptorSinglePriv.html">keys::DescriptorSinglePriv</a></li><li><a href="keys/struct.DescriptorSinglePub.html">keys::DescriptorSinglePub</a></li><li><a href="keys/struct.GeneratedKey.html">keys::GeneratedKey</a></li><li><a href="keys/struct.PrivateKeyGenerateOptions.html">keys::PrivateKeyGenerateOptions</a></li><li><a href="keys/struct.SortedMultiVec.html">keys::SortedMultiVec</a></li><li><a href="wallet/struct.Wallet.html">wallet::Wallet</a></li><li><a href="wallet/coin_selection/struct.BranchAndBoundCoinSelection.html">wallet::coin_selection::BranchAndBoundCoinSelection</a></li><li><a href="wallet/coin_selection/struct.CoinSelectionResult.html">wallet::coin_selection::CoinSelectionResult</a></li><li><a href="wallet/coin_selection/struct.LargestFirstCoinSelection.html">wallet::coin_selection::LargestFirstCoinSelection</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.BumpFee.html">wallet::tx_builder::BumpFee</a></li><li><a href="wallet/tx_builder/struct.CreateTx.html">wallet::tx_builder::CreateTx</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.KeychainKind.html">KeychainKind</a></li><li><a href="blockchain/enum.Capability.html">blockchain::Capability</a></li><li><a href="blockchain/any/enum.AnyBlockchain.html">blockchain::any::AnyBlockchain</a></li><li><a href="blockchain/any/enum.AnyBlockchainConfig.html">blockchain::any::AnyBlockchainConfig</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="database/any/enum.AnyBatch.html">database::any::AnyBatch</a></li><li><a href="database/any/enum.AnyDatabase.html">database::any::AnyDatabase</a></li><li><a href="database/any/enum.AnyDatabaseConfig.html">database::any::AnyDatabaseConfig</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="keys/enum.DescriptorKey.html">keys::DescriptorKey</a></li><li><a href="keys/enum.DescriptorPublicKey.html">keys::DescriptorPublicKey</a></li><li><a href="keys/enum.DescriptorSecretKey.html">keys::DescriptorSecretKey</a></li><li><a href="keys/enum.KeyError.html">keys::KeyError</a></li><li><a href="keys/enum.ScriptContextEnum.html">keys::ScriptContextEnum</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.ConfigurableBlockchain.html">blockchain::ConfigurableBlockchain</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.ConfigurableDatabase.html">database::ConfigurableDatabase</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="descriptor/trait.ToWalletDescriptor.html">descriptor::ToWalletDescriptor</a></li><li><a href="descriptor/template/trait.DescriptorTemplate.html">descriptor::template::DescriptorTemplate</a></li><li><a href="keys/trait.DerivableKey.html">keys::DerivableKey</a></li><li><a href="keys/trait.ExtScriptContext.html">keys::ExtScriptContext</a></li><li><a href="keys/trait.GeneratableDefaultOptions.html">keys::GeneratableDefaultOptions</a></li><li><a href="keys/trait.GeneratableKey.html">keys::GeneratableKey</a></li><li><a href="keys/trait.ScriptContext.html">keys::ScriptContext</a></li><li><a href="keys/trait.ToDescriptorKey.html">keys::ToDescriptorKey</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><li><a href="wallet/tx_builder/trait.TxBuilderContext.html">wallet::tx_builder::TxBuilderContext</a></li></ul><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.descriptor.html">descriptor</a></li><li><a href="macro.fragment.html">fragment</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="keys/fn.any_network.html">keys::any_network</a></li><li><a href="keys/fn.mainnet_network.html">keys::mainnet_network</a></li><li><a href="keys/fn.merge_networks.html">keys::merge_networks</a></li><li><a href="keys/fn.test_networks.html">keys::test_networks</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/type.KeyMap.html">descriptor::KeyMap</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="descriptor/template/type.DescriptorTemplateOut.html">descriptor::template::DescriptorTemplateOut</a></li><li><a href="keys/type.ValidNetworks.html">keys::ValidNetworks</a></li><li><a href="keys/bip39/type.MnemonicWithPassphrase.html">keys::bip39::MnemonicWithPassphrase</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 `AnyBlockchain` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AnyBlockchain"><title>bdk::blockchain::any::AnyBlockchain - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum AnyBlockchain</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.CompactFilters">CompactFilters</a><a href="#variant.Electrum">Electrum</a><a href="#variant.Esplora">Esplora</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-ConfigurableBlockchain">ConfigurableBlockchain</a><a href="#impl-From%3CCompactFiltersBlockchain%3E">From<CompactFiltersBlockchain></a><a href="#impl-From%3CElectrumBlockchain%3E">From<ElectrumBlockchain></a><a href="#impl-From%3CEsploraBlockchain%3E">From<EsploraBlockchain></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "AnyBlockchain", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#119-132" 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">any</a>::<wbr><a class="enum" href="">AnyBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum AnyBlockchain {
+ Electrum(<a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>),
+ Esplora(<a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>),
+ CompactFilters(<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>),
+}</pre></div><div class="docblock"><p>Type that can contain any of the <a href="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> types defined by the library</p>
+<p>It allows switching backend at runtime</p>
+<p>See <a href="../../../bdk/blockchain/any/index.html">this module</a>'s documentation for a usage example.</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Electrum" class="variant small-section-header"><a href="#variant.Electrum" class="anchor field"></a><code>Electrum(<a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="docblock"><p>Electrum client</p>
+</div><div id="variant.Esplora" class="variant small-section-header"><a href="#variant.Esplora" class="anchor field"></a><code>Esplora(<a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="docblock"><p>Esplora client</p>
+</div><div id="variant.CompactFilters" class="variant small-section-header"><a href="#variant.CompactFilters" class="anchor field"></a><code>CompactFilters(<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>Compact filters client</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="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-Blockchain" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#135-182" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.get_capabilities" class="method hidden"><code>pub 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/any.rs.html#136-138" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../bdk/blockchain/enum.Capability.html" title="Capability"><code>Capability</code></a> supported by this backend</p>
+</div><h4 id="method.setup" class="method hidden"><code>pub 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/any.rs.html#140-153" 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.sync" class="method hidden"><code>pub 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/any.rs.html#154-167" 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><h4 id="method.get_tx" class="method hidden"><code>pub 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/any.rs.html#169-171" 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>pub 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/any.rs.html#172-174" 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>pub 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/any.rs.html#176-178" 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>pub 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/any.rs.html#179-181" 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></div><h3 id="impl-ConfigurableBlockchain" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html" title="trait bdk::blockchain::ConfigurableBlockchain">ConfigurableBlockchain</a> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-ConfigurableBlockchain" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#209-228" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" class="type">Config</a> = <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/any.rs.html#212-227" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</p>
+</div></div><h3 id="impl-From%3CCompactFiltersBlockchain%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="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CCompactFiltersBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#186" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CElectrumBlockchain%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="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CElectrumBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#184" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#184" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CEsploraBlockchain%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="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CEsploraBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#185" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#185" 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/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#96" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `AnyBlockchainConfig` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AnyBlockchainConfig"><title>bdk::blockchain::any::AnyBlockchainConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum AnyBlockchainConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.CompactFilters">CompactFilters</a><a href="#variant.Electrum">Electrum</a><a href="#variant.Esplora">Esplora</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-From%3CCompactFiltersBlockchainConfig%3E">From<CompactFiltersBlockchainConfig></a><a href="#impl-From%3CElectrumBlockchainConfig%3E">From<ElectrumBlockchainConfig></a><a href="#impl-From%3CEsploraBlockchainConfig%3E">From<EsploraBlockchainConfig></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "AnyBlockchainConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#194-207" 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">any</a>::<wbr><a class="enum" href="">AnyBlockchainConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum AnyBlockchainConfig {
+ Electrum(<a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>),
+ Esplora(<a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>),
+ CompactFilters(<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>),
+}</pre></div><div class="docblock"><p>Type that can contain any of the blockchain configurations defined by the library</p>
+<p>This allows storing a single configuration that can be loaded into an <a href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="AnyBlockchain"><code>AnyBlockchain</code></a>
+instance. Wallets that plan to offer users the ability to switch blockchain backend at runtime
+will find this particularly useful.</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Electrum" class="variant small-section-header"><a href="#variant.Electrum" class="anchor field"></a><code>Electrum(<a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="docblock"><p>Electrum client</p>
+</div><div id="variant.Esplora" class="variant small-section-header"><a href="#variant.Esplora" class="anchor field"></a><code>Esplora(<a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="docblock"><p>Esplora client</p>
+</div><div id="variant.CompactFilters" class="variant small-section-header"><a href="#variant.CompactFilters" class="anchor field"></a><code>CompactFilters(<a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>Compact filters client</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/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#193" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/any.rs.html#193" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#193" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#193" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3CCompactFiltersBlockchainConfig%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="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CCompactFiltersBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#232" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#232" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CElectrumBlockchainConfig%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="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CElectrumBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#230" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#230" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CEsploraBlockchainConfig%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="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CEsploraBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#231" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#231" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#193" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#193" 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.118/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/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `any` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, any"><title>bdk::blockchain::any - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module any</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">blockchain</a></p><script>window.sidebarCurrent = {name: "any", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#25-232" 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="">any</a></span></h1><div class="docblock"><p>Runtime-checked blockchain types</p>
+<p>This module provides the implementation of <a href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="AnyBlockchain"><code>AnyBlockchain</code></a> which allows switching the
+inner <a href="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> type at runtime.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>In this example both <code>wallet_electrum</code> and <code>wallet_esplora</code> have the same type of
+<code>Wallet<AnyBlockchain, MemoryDatabase></code>. This means that they could both, for instance, be
+assigned to a struct member.</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">electrum_blockchain</span> <span class="op">=</span> <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">electrum_client</span>::<span class="ident">Client</span>::<span class="ident">new</span>(<span class="string">"..."</span>)<span class="question-mark">?</span>);
+<span class="kw">let</span> <span class="ident">wallet_electrum</span>: <span class="ident">Wallet</span><span class="op"><</span><span class="ident">AnyBlockchain</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new</span>(
+ <span class="string">"..."</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="ident">electrum_blockchain</span>.<span class="ident">into</span>(),
+)<span class="question-mark">?</span>;
+
+<span class="kw">let</span> <span class="ident">esplora_blockchain</span> <span class="op">=</span> <span class="ident">EsploraBlockchain</span>::<span class="ident">new</span>(<span class="string">"..."</span>, <span class="prelude-val">None</span>);
+<span class="kw">let</span> <span class="ident">wallet_esplora</span>: <span class="ident">Wallet</span><span class="op"><</span><span class="ident">AnyBlockchain</span>, <span class="kw">_</span><span class="op">></span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new</span>(
+ <span class="string">"..."</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="ident">esplora_blockchain</span>.<span class="ident">into</span>(),
+)<span class="question-mark">?</span>;
+</pre></div>
+<p>When paired with the use of <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html" title="ConfigurableBlockchain"><code>ConfigurableBlockchain</code></a>, it allows creating wallets with any
+blockchain type supported using a single line of code:</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">config</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="string">"..."</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">blockchain</span> <span class="op">=</span> <span class="ident">AnyBlockchain</span>::<span class="ident">from_config</span>(<span class="kw-2">&</span><span class="ident">config</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">wallet</span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new</span>(
+ <span class="string">"..."</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="ident">blockchain</span>,
+)<span class="question-mark">?</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.AnyBlockchain.html" title="bdk::blockchain::any::AnyBlockchain enum">AnyBlockchain</a></td><td class="docblock-short"><p>Type that can contain any of the <a href="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> types defined by the library</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.AnyBlockchainConfig.html" title="bdk::blockchain::any::AnyBlockchainConfig enum">AnyBlockchainConfig</a></td><td class="docblock-short"><p>Type that can contain any of the blockchain configurations defined by the library</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":[["AnyBlockchain","Type that can contain any of the [`Blockchain`] types defined by the library"],["AnyBlockchainConfig","Type that can contain any of the blockchain configurations defined by the library"]]});
\ 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#528-561" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>An error that can occur during sync with a <a href="../../../bdk/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="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="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="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="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="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="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="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="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="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="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="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="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="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="../../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>)</code></div><div class="docblock"><p>Wrapper for <a href="../../../bdk/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="../../../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#527" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#527" 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#563-567" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#564-566" 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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#197-204" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#198-203" 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#571" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#571" 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#572" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#572" 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#573" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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#573" 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#576-580" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-5" class="method hidden"><code>pub 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#577-579" 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#574" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>pub 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#574" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-6" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-580" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> backend that
+uses BIP157 (aka "Neutrino") to populate the wallet's <a href="../../../bdk/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>
+<p>This is an <strong>EXPERIMENTAL</strong> feature, API and other major changes are expected.</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.BitcoinPeerConfig.html" title="bdk::blockchain::compact_filters::BitcoinPeerConfig struct">BitcoinPeerConfig</a></td><td class="docblock-short"><p>Data to connect to a Bitcoin P2P peer</p>
+</td></tr><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.CompactFiltersBlockchainConfig.html" title="bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig struct">CompactFiltersBlockchainConfig</a></td><td class="docblock-short"><p>Configuration for a <a href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="CompactFiltersBlockchain"><code>CompactFiltersBlockchain</code></a></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 <a href="../../../bdk/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 = "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":[["BitcoinPeerConfig","Data to connect to a Bitcoin P2P peer"],["CompactFiltersBlockchain","Structure implementing the required blockchain traits"],["CompactFiltersBlockchainConfig","Configuration for a [`CompactFiltersBlockchain`]"],["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 `BitcoinPeerConfig` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BitcoinPeerConfig"><title>bdk::blockchain::compact_filters::BitcoinPeerConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BitcoinPeerConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.address">address</a><a href="#structfield.socks5">socks5</a><a href="#structfield.socks5_credentials">socks5_credentials</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-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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "BitcoinPeerConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#473-480" 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="">BitcoinPeerConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BitcoinPeerConfig {
+ pub address: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub socks5: <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>>,
+ pub socks5_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="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/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><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>Data to connect to a Bitcoin P2P peer</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.address" class="structfield small-section-header"><a href="#structfield.address" class="anchor field"></a><code>address: <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>Peer address such as 127.0.0.1:18333</p>
+</div><span id="structfield.socks5" class="structfield small-section-header"><a href="#structfield.socks5" class="anchor field"></a><code>socks5: <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></span><div class="docblock"><p>Optional socks5 proxy</p>
+</div><span id="structfield.socks5_credentials" class="structfield small-section-header"><a href="#structfield.socks5_credentials" class="anchor field"></a><code>socks5_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="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/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>></code></span><div class="docblock"><p>Optional socks5 proxy credentials</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/blockchain/compact_filters/struct.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#472" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#472" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#472" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#472" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#472" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#472" 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.118/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/blockchain/compact_filters/struct.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-ConfigurableBlockchain">ConfigurableBlockchain</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CCompactFiltersBlockchain%3E">From<CompactFiltersBlockchain></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#104-108" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../bdk/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="../../../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#110-235" 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="../../../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#119-153" 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 <a href="../../../bdk/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="../../../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#237-469" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.get_capabilities" class="method hidden"><code>pub 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#238-240" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../bdk/blockchain/enum.Capability.html" title="Capability"><code>Capability</code></a> supported by this backend</p>
+</div><h4 id="method.setup" class="method hidden"><code>pub 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#242-447" 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>pub 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#449-453" 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>pub 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#455-459" 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>pub 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#461-463" 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>pub 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#465-468" 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>pub 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#143-150" 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-ConfigurableBlockchain" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html" title="trait bdk::blockchain::ConfigurableBlockchain">ConfigurableBlockchain</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-ConfigurableBlockchain" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#495-524" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" class="type">Config</a> = <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/compact_filters/mod.rs.html#498-523" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</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#103" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#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-From%3CCompactFiltersBlockchain%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="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CCompactFiltersBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#186" 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/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#96" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `CompactFiltersBlockchainConfig` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CompactFiltersBlockchainConfig"><title>bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct CompactFiltersBlockchainConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.network">network</a><a href="#structfield.peers">peers</a><a href="#structfield.skip_blocks">skip_blocks</a><a href="#structfield.storage_dir">storage_dir</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-From%3CCompactFiltersBlockchainConfig%3E">From<CompactFiltersBlockchainConfig></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "CompactFiltersBlockchainConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#484-493" 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="">CompactFiltersBlockchainConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct CompactFiltersBlockchainConfig {
+ pub 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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a>>,
+ pub network: Network,
+ pub storage_dir: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub 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>>,
+}</pre></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="docblock"><p>Configuration for a <a href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchain.html" title="CompactFiltersBlockchain"><code>CompactFiltersBlockchain</code></a></p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.peers" class="structfield small-section-header"><a href="#structfield.peers" class="anchor field"></a><code>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.BitcoinPeerConfig.html" title="struct bdk::blockchain::compact_filters::BitcoinPeerConfig">BitcoinPeerConfig</a>></code></span><div class="docblock"><p>List of peers to try to connect to for asking headers and filters</p>
+</div><span id="structfield.network" class="structfield small-section-header"><a href="#structfield.network" class="anchor field"></a><code>network: Network</code></span><div class="docblock"><p>Network used</p>
+</div><span id="structfield.storage_dir" class="structfield small-section-header"><a href="#structfield.storage_dir" class="anchor field"></a><code>storage_dir: <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>Storage dir to save partially downloaded headers and full blocks</p>
+</div><span id="structfield.skip_blocks" class="structfield small-section-header"><a href="#structfield.skip_blocks" class="anchor field"></a><code>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>></code></span><div class="docblock"><p>Optionally skip initial <code>skip_blocks</code> blocks (default: 0)</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/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#483" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#483" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#483" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#483" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3CCompactFiltersBlockchainConfig%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="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CCompactFiltersBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#232" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#232" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#483" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/compact_filters/mod.rs.html#483" 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.118/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/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../bdk/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="../../../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>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="../../../bdk/blockchain/trait.Blockchain.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/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>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>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>pub 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>pub 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../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>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="bitcoin::network::message::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="../../../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>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>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>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>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>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>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>pub 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-190" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="docblock"><p>Electrum</p>
+<p>This module defines a <a href="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> struct that wraps an [<code>electrum_client::Client</code>]
+and implements the logic required to populate the wallet's <a href="../../../bdk/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="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><tr class="module-item"><td><a class="struct" href="struct.ElectrumBlockchainConfig.html" title="bdk::blockchain::electrum::ElectrumBlockchainConfig struct">ElectrumBlockchainConfig</a></td><td class="docblock-short"><p>Configuration for an <a href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="ElectrumBlockchain"><code>ElectrumBlockchain</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
+initSidebarItems({"struct":[["ElectrumBlockchain","Wrapper over an Electrum Client that implements the required blockchain traits"],["ElectrumBlockchainConfig","Configuration for an [`ElectrumBlockchain`]"]]});
\ 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-ConfigurableBlockchain">ConfigurableBlockchain</a><a href="#impl-From%3CClient%3E">From<Client></a><a href="#impl-From%3CElectrumBlockchain%3E">From<ElectrumBlockchain></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../bdk/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="../../../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>pub 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 <a href="../../../bdk/blockchain/enum.Capability.html" title="Capability"><code>Capability</code></a> supported by this backend</p>
+</div><h4 id="method.setup" class="method hidden"><code>pub 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>pub 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>pub 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>pub 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>pub 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>pub 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#143-150" 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-ConfigurableBlockchain" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html" title="trait bdk::blockchain::ConfigurableBlockchain">ConfigurableBlockchain</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href="#impl-ConfigurableBlockchain" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#174-190" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" class="type">Config</a> = <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/electrum.rs.html#177-189" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</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-1" class="method hidden"><code>pub 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><h3 id="impl-From%3CElectrumBlockchain%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="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CElectrumBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#184" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#184" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#96" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `ElectrumBlockchainConfig` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ElectrumBlockchainConfig"><title>bdk::blockchain::electrum::ElectrumBlockchainConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct ElectrumBlockchainConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.retry">retry</a><a href="#structfield.socks5">socks5</a><a href="#structfield.timeout">timeout</a><a href="#structfield.url">url</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-From%3CElectrumBlockchainConfig%3E">From<ElectrumBlockchainConfig></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "ElectrumBlockchainConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#161-172" 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="">ElectrumBlockchainConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct ElectrumBlockchainConfig {
+ pub url: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub socks5: <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>>,
+ pub retry: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>,
+ pub timeout: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>,
+}</pre></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="docblock"><p>Configuration for an <a href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="ElectrumBlockchain"><code>ElectrumBlockchain</code></a></p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.url" class="structfield small-section-header"><a href="#structfield.url" class="anchor field"></a><code>url: <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>URL of the Electrum server (such as ElectrumX, Esplora, BWT) may start with <code>ssl://</code> or <code>tcp://</code> and include a port</p>
+<p>eg. <code>ssl://electrum.blockstream.info:60002</code></p>
+</div><span id="structfield.socks5" class="structfield small-section-header"><a href="#structfield.socks5" class="anchor field"></a><code>socks5: <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></span><div class="docblock"><p>URL of the socks5 proxy server or a Tor service</p>
+</div><span id="structfield.retry" class="structfield small-section-header"><a href="#structfield.retry" class="anchor field"></a><code>retry: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span><div class="docblock"><p>Request retry count</p>
+</div><span id="structfield.timeout" class="structfield small-section-header"><a href="#structfield.timeout" class="anchor field"></a><code>timeout: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span><div class="docblock"><p>Request timeout (seconds)</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/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#160" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/electrum.rs.html#160" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#160" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#160" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3CElectrumBlockchainConfig%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="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CElectrumBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#230" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#230" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#160" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/electrum.rs.html#160" 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.118/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/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#73-80" 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 <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</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="../../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#72" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#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>pub 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#128-130" 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#72" 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#72" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#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-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#72" 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#72" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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#72" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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#72" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#72" 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>pub 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#209-211" 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#72" 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#72" 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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.HeaderHashNotFound">HeaderHashNotFound</a><a href="#variant.HeaderHeightNotFound">HeaderHeightNotFound</a><a href="#variant.Hex">Hex</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#400-416" 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.10/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/error/struct.ParseIntError.html" title="struct core::num::error::ParseIntError">ParseIntError</a>),
+ BitcoinEncoding(Error),
+ Hex(Error),
+ TransactionNotFound(Txid),
+ HeaderHeightNotFound(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>),
+ HeaderHashNotFound(BlockHash),
+}</pre></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="docblock"><p>Errors that can happen during a sync with <a href="../../../bdk/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.10/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>Parsing(<a class="struct" href="https://doc.rust-lang.org/nightly/core/num/error/struct.ParseIntError.html" title="struct core::num::error::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>BitcoinEncoding(Error)</code></div><div class="docblock"><p>Invalid Bitcoin data returned</p>
+</div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code>Hex(Error)</code></div><div class="docblock"><p>Invalid Hex 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="docblock"><p>Transaction not found</p>
+</div><div id="variant.HeaderHeightNotFound" class="variant small-section-header"><a href="#variant.HeaderHeightNotFound" class="anchor field"></a><code>HeaderHeightNotFound(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code></div><div class="docblock"><p>Header height not found</p>
+</div><div id="variant.HeaderHashNotFound" class="variant small-section-header"><a href="#variant.HeaderHashNotFound" class="anchor field"></a><code>HeaderHashNotFound(BlockHash)</code></div><div class="docblock"><p>Header hash 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#399" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#399" 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#418-422" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#419-421" 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#424" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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.10/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#426" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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/reqwest/0.10.10/reqwest/error/struct.Error.html" title="struct reqwest::error::Error">Error</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#426" 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#428" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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/esplora.rs.html#428" 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/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a></code><a href="#impl-From%3CError%3E-2" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#429" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>pub 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/esplora.rs.html#429" 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#192" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#192" 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/error/struct.ParseIntError.html" title="struct core::num::error::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#427" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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/core/num/error/struct.ParseIntError.html" title="struct core::num::error::ParseIntError">ParseIntError</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#427" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-5" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-429" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="docblock"><p>Esplora</p>
+<p>This module defines a <a href="../../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> struct that can query an Esplora backend
+populate the wallet's <a href="../../../bdk/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>, <span class="prelude-val">None</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><tr class="module-item"><td><a class="struct" href="struct.EsploraBlockchainConfig.html" title="bdk::blockchain::esplora::EsploraBlockchainConfig struct">EsploraBlockchainConfig</a></td><td class="docblock-short"><p>Configuration for an <a href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="EsploraBlockchain"><code>EsploraBlockchain</code></a></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 <a href="../../../bdk/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 = "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"],["EsploraBlockchainConfig","Configuration for an [`EsploraBlockchain`]"]]});
\ 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-ConfigurableBlockchain">ConfigurableBlockchain</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CEsploraBlockchain%3E">From<EsploraBlockchain></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#78" 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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>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="../../../bdk/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="../../../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#86-95" 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>, concurrency: <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.u8.html">u8</a>>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#88-94" 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#98-148" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.get_capabilities" class="method hidden"><code>pub 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#99-107" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the set of <a href="../../../bdk/blockchain/enum.Capability.html" title="Capability"><code>Capability</code></a> supported by this backend</p>
+</div><h4 id="method.setup" class="method hidden"><code>pub 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#109-118" 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>pub 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#120-122" 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>pub 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#124-126" 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>pub 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#128-130" 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>pub 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#132-147" 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>pub 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#143-150" 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-ConfigurableBlockchain" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html" title="trait bdk::blockchain::ConfigurableBlockchain">ConfigurableBlockchain</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href="#impl-ConfigurableBlockchain" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#387-396" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" class="type">Config</a> = <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/esplora.rs.html#390-395" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</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#77" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#77" 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%3CEsploraBlockchain%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="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-From%3CEsploraBlockchain%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#185" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#185" 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/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#96" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `EsploraBlockchainConfig` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, EsploraBlockchainConfig"><title>bdk::blockchain::esplora::EsploraBlockchainConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct EsploraBlockchainConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.base_url">base_url</a><a href="#structfield.concurrency">concurrency</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-From%3CEsploraBlockchainConfig%3E">From<EsploraBlockchainConfig></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "EsploraBlockchainConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#378-385" 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="">EsploraBlockchainConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct EsploraBlockchainConfig {
+ pub base_url: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub concurrency: <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.u8.html">u8</a>>,
+}</pre></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="docblock"><p>Configuration for an <a href="../../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="EsploraBlockchain"><code>EsploraBlockchain</code></a></p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.base_url" class="structfield small-section-header"><a href="#structfield.base_url" class="anchor field"></a><code>base_url: <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>Base URL of the esplora service</p>
+<p>eg. <code>https://blockstream.info/api/</code></p>
+</div><span id="structfield.concurrency" class="structfield small-section-header"><a href="#structfield.concurrency" class="anchor field"></a><code>concurrency: <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.u8.html">u8</a>></code></span><div class="docblock"><p>Number of parallel requests sent to the esplora service (default: 4)</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/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#377" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#377" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#377" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#377" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3CEsploraBlockchainConfig%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="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>> for <a class="enum" href="../../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code><a href="#impl-From%3CEsploraBlockchainConfig%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#231" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a>) -> Self</code><a class="srclink" href="../../../src/bdk/blockchain/any.rs.html#231" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#377" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/blockchain/esplora.rs.html#377" 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.118/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/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#221-223" 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 <a href="../../bdk/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 = "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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#206-208" 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 <a href="../../bdk/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 = "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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-188" 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 <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="../../bdk/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 = "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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-274" 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="../../bdk/blockchain/electrum/index.html">Electrum</a>, <a href="../../bdk/blockchain/esplora/index.html">Esplora</a> and
+<a href="../../bdk/blockchain/compact_filters/index.html">Compact Filters/Neutrino</a>, along with a generalized trait
+<a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> 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 any::<a class="enum" href="../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a>;</code></td></tr><tr><td><code>pub use any::<a class="enum" href="../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a>;</code></td></tr><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::electrum::<a class="struct" href="../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</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="any/index.html" title="bdk::blockchain::any mod">any</a></td><td class="docblock-short"><p>Runtime-checked blockchain types</p>
+</td></tr><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"><span class="stab portability" title="This is supported on crate feature `compact_filters` only"><code>compact_filters</code></span><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"><span class="stab portability" title="This is supported on crate feature `electrum` only"><code>electrum</code></span><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"><span class="stab portability" title="This is supported on crate feature `esplora` only"><code>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="bdk::blockchain::LogProgress struct">LogProgress</a></td><td class="docblock-short"><p>Type that implements <a href="../../bdk/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="bdk::blockchain::NoopProgress struct">NoopProgress</a></td><td class="docblock-short"><p>Type that implements <a href="../../bdk/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="bdk::blockchain::OfflineBlockchain struct">OfflineBlockchain</a></td><td class="docblock-short"><p>Type that only implements <a href="../../bdk/blockchain/trait.BlockchainMarker.html" title="BlockchainMarker"><code>BlockchainMarker</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="bdk::blockchain::Capability enum">Capability</a></td><td class="docblock-short"><p>Capabilities that can be supported by a <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</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="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.ConfigurableBlockchain.html" title="bdk::blockchain::ConfigurableBlockchain trait">ConfigurableBlockchain</a></td><td class="docblock-short"><p>Trait for <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> types that can be created given a configuration</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 <a href="../../bdk/blockchain/trait.Blockchain.html#method.sync" title="Blockchain::sync"><code>Blockchain::sync</code></a> and
+<a href="../../bdk/blockchain/trait.Blockchain.html#tymethod.setup" title="Blockchain::setup"><code>Blockchain::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="bdk::blockchain::log_progress fn">log_progress</a></td><td class="docblock-short"><p>Create a nwe instance of <a href="../../bdk/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="bdk::blockchain::noop_progress fn">noop_progress</a></td><td class="docblock-short"><p>Create a new instance of <a href="../../bdk/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="bdk::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="../../bdk/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="bdk::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 = "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":[["any","Runtime-checked blockchain types"],["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 [`BlockchainMarker`] 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"],["ConfigurableBlockchain","Trait for [`Blockchain`] types that can be created given a configuration"],["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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#218" 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 <a href="../../bdk/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="../../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#217" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#217" 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>pub 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#128-130" 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#225-235" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update" class="method hidden"><code>pub fn <a href="../../bdk/blockchain/trait.Progress.html#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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#226-234" 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#203" 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 <a href="../../bdk/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="../../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#202" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#202" 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>pub 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#128-130" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update" class="method hidden"><code>pub fn <a href="../../bdk/blockchain/trait.Progress.html#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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#211-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.NoopProgress.html" title="struct bdk::blockchain::NoopProgress">NoopProgress</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#99" 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 <a href="../../bdk/blockchain/trait.BlockchainMarker.html" title="BlockchainMarker"><code>BlockchainMarker</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-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#100" 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#104-161" 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> {
+ pub 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> pub 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> pub 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> pub 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> pub 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> pub 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>>;
+
+ pub 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>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#106" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the set of <a href="../../bdk/blockchain/enum.Capability.html" title="Capability"><code>Capability</code></a> supported by this backend</p>
+</div><h3 id="tymethod.setup" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#118-123" title="goto source code">[src]</a></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="../../bdk/blockchain/trait.Blockchain.html#method.sync" title="Blockchain::sync"><code>Blockchain::sync</code></a>, but it's guaranteed to only be
+called once, at the first <a href="../../bdk/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="../../bdk/blockchain/trait.Blockchain.html#method.sync" title="Blockchain::sync"><code>Blockchain::sync</code></a> defaults to calling this internally if not overridden.</p>
+</div><h3 id="tymethod.get_tx" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#153" title="goto source code">[src]</a></h3><div class="docblock"><p>Fetch a transaction from the blockchain given its txid</p>
+</div><h3 id="tymethod.broadcast" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#155" title="goto source code">[src]</a></h3><div class="docblock"><p>Broadcast a transaction</p>
+</div><h3 id="tymethod.get_height" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#158" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the current height</p>
+</div><h3 id="tymethod.estimate_fee" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#160" title="goto source code">[src]</a></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>pub 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#143-150" title="goto source code">[src]</a></h3><div class="docblock"><p>Populate the internal database with transactions and UTXOs</p>
+<p>If not overridden, it defaults to calling <a href="../../bdk/blockchain/trait.Blockchain.html#tymethod.setup" title="Blockchain::setup"><code>Blockchain::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="../../bdk/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="../../bdk/database/trait.BatchOperations.html#tymethod.set_tx"><code>BatchOperations::set_tx</code></a> and
+<a href="../../bdk/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="../../bdk/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="../../bdk/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-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#238-274" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.get_capabilities" class="method hidden"><code>pub 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#239-241" title="goto source code">[src]</a></h4><h4 id="method.setup" class="method hidden"><code>pub 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#243-250" title="goto source code">[src]</a></h4><h4 id="method.sync-1" class="method hidden"><code>pub 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#252-259" title="goto source code">[src]</a></h4><h4 id="method.get_tx" class="method hidden"><code>pub 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#261-263" title="goto source code">[src]</a></h4><h4 id="method.broadcast" class="method hidden"><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><<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#264-266" title="goto source code">[src]</a></h4><h4 id="method.get_height" class="method hidden"><code>pub 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#268-270" title="goto source code">[src]</a></h4><h4 id="method.estimate_fee" class="method hidden"><code>pub 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#271-273" 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="enum" href="../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-Blockchain" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/any.rs.html#135-182" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.get_capabilities-1" class="method hidden"><code>pub 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/any.rs.html#136-138" title="goto source code">[src]</a></h4><h4 id="method.setup-1" class="method hidden"><code>pub 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/any.rs.html#140-153" title="goto source code">[src]</a></h4><h4 id="method.sync-2" class="method hidden"><code>pub fn <a href="#method.sync-2" 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/any.rs.html#154-167" title="goto source code">[src]</a></h4><h4 id="method.get_tx-1" class="method hidden"><code>pub 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/any.rs.html#169-171" title="goto source code">[src]</a></h4><h4 id="method.broadcast-1" class="method hidden"><code>pub 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/any.rs.html#172-174" title="goto source code">[src]</a></h4><h4 id="method.get_height-1" class="method hidden"><code>pub 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/any.rs.html#176-178" title="goto source code">[src]</a></h4><h4 id="method.estimate_fee-1" class="method hidden"><code>pub 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/any.rs.html#179-181" 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/compact_filters/struct.CompactFiltersBlockchain.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchain">CompactFiltersBlockchain</a></code><a href="#impl-Blockchain-1" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/compact_filters/mod.rs.html#237-469" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="impl-items"><h4 id="method.get_capabilities-2" class="method hidden"><code>pub 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/compact_filters/mod.rs.html#238-240" title="goto source code">[src]</a></h4><h4 id="method.setup-2" class="method hidden"><code>pub 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: '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#242-447" title="goto source code">[src]</a></h4><h4 id="method.get_tx-2" class="method hidden"><code>pub 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/compact_filters/mod.rs.html#449-453" title="goto source code">[src]</a></h4><h4 id="method.broadcast-2" class="method hidden"><code>pub 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/compact_filters/mod.rs.html#455-459" title="goto source code">[src]</a></h4><h4 id="method.get_height-2" class="method hidden"><code>pub 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/compact_filters/mod.rs.html#461-463" title="goto source code">[src]</a></h4><h4 id="method.estimate_fee-2" class="method hidden"><code>pub 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/compact_filters/mod.rs.html#465-468" 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/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href="#impl-Blockchain-2" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/electrum.rs.html#74-117" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="impl-items"><h4 id="method.get_capabilities-3" class="method hidden"><code>pub 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/electrum.rs.html#75-83" title="goto source code">[src]</a></h4><h4 id="method.setup-3" class="method hidden"><code>pub 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/electrum.rs.html#85-93" title="goto source code">[src]</a></h4><h4 id="method.get_tx-3" class="method hidden"><code>pub 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/electrum.rs.html#95-97" title="goto source code">[src]</a></h4><h4 id="method.broadcast-3" class="method hidden"><code>pub 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/electrum.rs.html#99-101" title="goto source code">[src]</a></h4><h4 id="method.get_height-3" class="method hidden"><code>pub 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/electrum.rs.html#103-110" title="goto source code">[src]</a></h4><h4 id="method.estimate_fee-3" class="method hidden"><code>pub 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/electrum.rs.html#112-116" 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="../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href="#impl-Blockchain-3" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/esplora.rs.html#98-148" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="impl-items"><h4 id="method.get_capabilities-4" class="method hidden"><code>pub fn <a href="#method.get_capabilities-4" 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#99-107" title="goto source code">[src]</a></h4><h4 id="method.setup-4" class="method hidden"><code>pub fn <a href="#method.setup-4" 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#109-118" title="goto source code">[src]</a></h4><h4 id="method.get_tx-4" class="method hidden"><code>pub fn <a href="#method.get_tx-4" 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#120-122" title="goto source code">[src]</a></h4><h4 id="method.broadcast-4" class="method hidden"><code>pub fn <a href="#method.broadcast-4" 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#124-126" title="goto source code">[src]</a></h4><h4 id="method.get_height-4" class="method hidden"><code>pub fn <a href="#method.get_height-4" 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#128-130" title="goto source code">[src]</a></h4><h4 id="method.estimate_fee-4" class="method hidden"><code>pub fn <a href="#method.estimate_fee-4" 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#132-147" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#93" 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 <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a>, 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 <a href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="OfflineBlockchain"><code>OfflineBlockchain</code></a>
+already does that, and whenever <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> 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#100" 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#96" title="goto source code">[src]</a></h3><div class="docblock"><p>The <a href="../../bdk/blockchain/trait.BlockchainMarker.html" title="BlockchainMarker"><code>BlockchainMarker</code></a> marker trait is automatically implemented for <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> 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 `ConfigurableBlockchain` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ConfigurableBlockchain"><title>bdk::blockchain::ConfigurableBlockchain - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait ConfigurableBlockchain</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.Config">Config</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.from_config">from_config</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: "ConfigurableBlockchain", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#164-170" 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="">ConfigurableBlockchain</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait ConfigurableBlockchain: <a class="trait" href="../../bdk/blockchain/trait.Blockchain.html" title="trait bdk::blockchain::Blockchain">Blockchain</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
+ type <a href="#associatedtype.Config" class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
+ pub fn <a href="#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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>>;
+}</pre></div><div class="docblock"><p>Trait for <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a> types that can be created given a configuration</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.Config" class="method"><code>type <a href="#associatedtype.Config" class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#166" title="goto source code">[src]</a></h3><div class="docblock"><p>Type that contains the configuration</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.from_config" class="method"><code>pub fn <a href="#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/mod.rs.html#169" title="goto source code">[src]</a></h3><div class="docblock"><p>Create a new instance given a configuration</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-ConfigurableBlockchain" class="impl"><code class="in-band">impl ConfigurableBlockchain for <a class="enum" href="../../bdk/blockchain/any/enum.AnyBlockchain.html" title="enum bdk::blockchain::any::AnyBlockchain">AnyBlockchain</a></code><a href="#impl-ConfigurableBlockchain" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/any.rs.html#209-228" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config-1" class="type"><code>type <a href="#associatedtype.Config-1" class="type">Config</a> = <a class="enum" href="../../bdk/blockchain/any/enum.AnyBlockchainConfig.html" title="enum bdk::blockchain::any::AnyBlockchainConfig">AnyBlockchainConfig</a></code></h4><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="#method.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/any.rs.html#212-227" title="goto source code">[src]</a></h4></div><h3 id="impl-ConfigurableBlockchain-1" class="impl"><code class="in-band">impl ConfigurableBlockchain 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-ConfigurableBlockchain-1" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/compact_filters/mod.rs.html#495-524" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="impl-items"><h4 id="associatedtype.Config-2" class="type"><code>type <a href="#associatedtype.Config-2" class="type">Config</a> = <a class="struct" href="../../bdk/blockchain/compact_filters/struct.CompactFiltersBlockchainConfig.html" title="struct bdk::blockchain::compact_filters::CompactFiltersBlockchainConfig">CompactFiltersBlockchainConfig</a></code></h4><h4 id="method.from_config-1" class="method hidden"><code>pub fn <a href="#method.from_config-1" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/compact_filters/mod.rs.html#498-523" title="goto source code">[src]</a></h4></div><h3 id="impl-ConfigurableBlockchain-2" class="impl"><code class="in-band">impl ConfigurableBlockchain for <a class="struct" href="../../bdk/blockchain/electrum/struct.ElectrumBlockchain.html" title="struct bdk::blockchain::electrum::ElectrumBlockchain">ElectrumBlockchain</a></code><a href="#impl-ConfigurableBlockchain-2" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/electrum.rs.html#174-190" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>electrum</code></strong> only.</div></div><div class="impl-items"><h4 id="associatedtype.Config-3" class="type"><code>type <a href="#associatedtype.Config-3" class="type">Config</a> = <a class="struct" href="../../bdk/blockchain/electrum/struct.ElectrumBlockchainConfig.html" title="struct bdk::blockchain::electrum::ElectrumBlockchainConfig">ElectrumBlockchainConfig</a></code></h4><h4 id="method.from_config-2" class="method hidden"><code>pub fn <a href="#method.from_config-2" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/electrum.rs.html#177-189" title="goto source code">[src]</a></h4></div><h3 id="impl-ConfigurableBlockchain-3" class="impl"><code class="in-band">impl ConfigurableBlockchain for <a class="struct" href="../../bdk/blockchain/esplora/struct.EsploraBlockchain.html" title="struct bdk::blockchain::esplora::EsploraBlockchain">EsploraBlockchain</a></code><a href="#impl-ConfigurableBlockchain-3" class="anchor"></a><a class="srclink" href="../../src/bdk/blockchain/esplora.rs.html#387-396" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>esplora</code></strong> only.</div></div><div class="impl-items"><h4 id="associatedtype.Config-4" class="type"><code>type <a href="#associatedtype.Config-4" class="type">Config</a> = <a class="struct" href="../../bdk/blockchain/esplora/struct.EsploraBlockchainConfig.html" title="struct bdk::blockchain::esplora::EsploraBlockchainConfig">EsploraBlockchainConfig</a></code></h4><h4 id="method.from_config-3" class="method hidden"><code>pub fn <a href="#method.from_config-3" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/blockchain/trait.ConfigurableBlockchain.html#associatedtype.Config" title="type bdk::blockchain::ConfigurableBlockchain::Config">Config</a>) -> <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/blockchain/esplora.rs.html#390-395" 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.ConfigurableBlockchain.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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#177-183" 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> {
+ pub 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 <a href="../../bdk/blockchain/trait.Blockchain.html#method.sync" title="Blockchain::sync"><code>Blockchain::sync</code></a> and
+<a href="../../bdk/blockchain/trait.Blockchain.html#tymethod.setup" title="Blockchain::setup"><code>Blockchain::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>pub 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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#182" title="goto source code">[src]</a></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#190-199" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update" class="method hidden"><code>pub fn <a href="#method.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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#191-198" 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#225-235" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update-1" class="method hidden"><code>pub fn <a href="#method.update-1" 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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#226-234" 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update-2" class="method hidden"><code>pub fn <a href="#method.update-2" 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>></code><a class="srclink" href="../../src/bdk/blockchain/mod.rs.html#211-213" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#173" 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 <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 = "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 `AnyBatch` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AnyBatch"><title>bdk::database::any::AnyBatch - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum AnyBatch</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Memory">Memory</a><a href="#variant.Sled">Sled</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-BatchOperations">BatchOperations</a><a href="#impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%3E">From<<MemoryDatabase as BatchDatabase>::Batch></a><a href="#impl-From%3C%3CTree%20as%20BatchDatabase%3E%3A%3ABatch%3E">From<<Tree as BatchDatabase>::Batch></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "AnyBatch", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#106-113" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">database</a>::<wbr><a href="index.html">any</a>::<wbr><a class="enum" href="">AnyBatch</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum AnyBatch {
+ Memory(<<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>),
+ Sled(<Tree as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>),
+}</pre></div><div class="docblock"><p>Type that contains any of the <a href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="BatchDatabase::Batch"><code>BatchDatabase::Batch</code></a> types defined by the library</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Memory" class="variant small-section-header"><a href="#variant.Memory" class="anchor field"></a><code>Memory(<<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>)</code></div><div class="docblock"><p>In-memory ephemeral database</p>
+</div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code>Sled(<Tree as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>key-value-db</code></strong> only.</div></div><div class="docblock"><p>Simple key-value embedded database based on [<code>sled</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-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="enum" href="../../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-BatchOperations" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#253-304" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.set_script_pubkey" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/database/any.rs.html#254-261" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store a script_pubkey along with its keychain and child number.</p>
+</div><h4 id="method.set_utxo" class="method hidden"><code>pub 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/any.rs.html#262-264" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store a <a href="../../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a></p>
+</div><h4 id="method.set_raw_tx" class="method hidden"><code>pub 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/any.rs.html#265-267" 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>pub 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/any.rs.html#268-270" 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#271-273" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store the last derivation index for a given keychain.</p>
+</div><h4 id="method.del_script_pubkey_from_path" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/database/any.rs.html#275-281" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete a script_pubkey given the keychain and its child number.</p>
+</div><h4 id="method.del_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#282-287" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete the data related to a specific script_pubkey, meaning the keychain 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>pub 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/any.rs.html#288-290" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete a <a href="../../../bdk/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>pub 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/any.rs.html#291-293" 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>pub 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/any.rs.html#294-300" 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#301-303" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete the last derivation index for a keychain.</p>
+</div></div><h3 id="impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%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="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#115-119" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#115-119" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3C%3CTree%20as%20BatchDatabase%3E%3A%3ABatch%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><<Tree as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-From%3C%3CTree%20as%20BatchDatabase%3E%3A%3ABatch%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#120" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <Tree as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#120" 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/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `AnyDatabase` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AnyDatabase"><title>bdk::database::any::AnyDatabase - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum AnyDatabase</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Memory">Memory</a><a href="#variant.Sled">Sled</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-ConfigurableDatabase">ConfigurableDatabase</a><a href="#impl-Database">Database</a><a href="#impl-Debug">Debug</a><a href="#impl-From%3CMemoryDatabase%3E">From<MemoryDatabase></a><a href="#impl-From%3CTree%3E">From<Tree></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "AnyDatabase", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#93-100" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">database</a>::<wbr><a href="index.html">any</a>::<wbr><a class="enum" href="">AnyDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum AnyDatabase {
+ Memory(<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>),
+ Sled(Tree),
+}</pre></div><div class="docblock"><p>Type that can contain any of the <a href="../../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> types defined by the library</p>
+<p>It allows switching database type at runtime.</p>
+<p>See <a href="../../../bdk/database/any/index.html">this module</a>'s documentation for a usage example.</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Memory" class="variant small-section-header"><a href="#variant.Memory" class="anchor field"></a><code>Memory(<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>)</code></div><div class="docblock"><p>In-memory ephemeral database</p>
+</div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code>Sled(Tree)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>key-value-db</code></strong> only.</div></div><div class="docblock"><p>Simple key-value embedded database based on [<code>sled</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-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="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-BatchDatabase" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#306-337" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Batch" class="type"><code>type <a href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" class="type">Batch</a> = <a class="enum" href="../../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code></h4><div class='docblock'><p>Container for the operations</p>
+</div><h4 id="method.begin_batch" class="method hidden"><code>pub 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/any.rs.html#309-315" 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>pub 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/any.rs.html#316-336" 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="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-BatchOperations" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#122-186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.set_script_pubkey" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/database/any.rs.html#123-137" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store a script_pubkey along with its keychain and child number.</p>
+</div><h4 id="method.set_utxo" class="method hidden"><code>pub 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/any.rs.html#138-140" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store a <a href="../../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a></p>
+</div><h4 id="method.set_raw_tx" class="method hidden"><code>pub 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/any.rs.html#141-143" 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>pub 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/any.rs.html#144-146" 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#147-149" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Store the last derivation index for a given keychain.</p>
+</div><h4 id="method.del_script_pubkey_from_path" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/database/any.rs.html#151-163" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete a script_pubkey given the keychain and its child number.</p>
+</div><h4 id="method.del_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#164-169" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete the data related to a specific script_pubkey, meaning the keychain 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>pub 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/any.rs.html#170-172" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete a <a href="../../../bdk/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>pub 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/any.rs.html#173-175" 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>pub 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/any.rs.html#176-182" 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#183-185" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Delete the last derivation index for a keychain.</p>
+</div></div><h3 id="impl-ConfigurableDatabase" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/database/trait.ConfigurableDatabase.html" title="trait bdk::database::ConfigurableDatabase">ConfigurableDatabase</a> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-ConfigurableDatabase" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#373-385" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" class="type">Config</a> = <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/database/trait.ConfigurableDatabase.html#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/any.rs.html#376-384" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</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="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Database" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#188-251" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.check_descriptor_checksum" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#189-201" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Read and checks the descriptor checksum for a given keychain. <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>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.iter_script_pubkeys" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#203-205" 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>pub 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/any.rs.html#206-208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the list of <a href="../../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a>s</p>
+</div><h4 id="method.iter_raw_txs" class="method hidden"><code>pub 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/any.rs.html#209-211" 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>pub fn <a href="../../../bdk/database/trait.Database.html#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>></code><a class="srclink" href="../../../src/bdk/database/any.rs.html#212-214" 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>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/database/any.rs.html#216-228" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Fetch a script_pubkey given the child number of a keychain.</p>
+</div><h4 id="method.get_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#229-234" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Fetch the keychain and child number of a given script_pubkey</p>
+</div><h4 id="method.get_utxo" class="method hidden"><code>pub 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/any.rs.html#235-237" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Fetch a <a href="../../../bdk/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>pub 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/any.rs.html#238-240" 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>pub 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/any.rs.html#241-243" 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>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.get_last_index" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#244-246" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the last defivation index for a keychain.</p>
+</div><h4 id="method.increment_last_index" class="method hidden"><code>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.increment_last_index" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#248-250" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Increment the last derivation index for a keychain and return 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="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/any.rs.html#92" 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%3CMemoryDatabase%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="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-From%3CMemoryDatabase%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#102" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#102" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CTree%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><Tree> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-From%3CTree%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#103" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: Tree) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#103" 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/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `AnyDatabaseConfig` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, AnyDatabaseConfig"><title>bdk::database::any::AnyDatabaseConfig - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum AnyDatabaseConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Memory">Memory</a><a href="#variant.Sled">Sled</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-From%3C()%3E">From<()></a><a href="#impl-From%3CSledDbConfiguration%3E">From<SledDbConfiguration></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "AnyDatabaseConfig", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#364-371" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">database</a>::<wbr><a href="index.html">any</a>::<wbr><a class="enum" href="">AnyDatabaseConfig</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum AnyDatabaseConfig {
+ Memory(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>),
+ Sled(<a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>),
+}</pre></div><div class="docblock"><p>Type that can contain any of the database configurations defined by the library</p>
+<p>This allows storing a single configuration that can be loaded into an <a href="../../../bdk/database/any/enum.AnyDatabase.html" title="AnyDatabase"><code>AnyDatabase</code></a>
+instance. Wallets that plan to offer users the ability to switch blockchain backend at runtime
+will find this particularly useful.</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Memory" class="variant small-section-header"><a href="#variant.Memory" class="anchor field"></a><code>Memory(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>)</code></div><div class="docblock"><p>Memory database has no config</p>
+</div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code>Sled(<a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>)</code></div><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>key-value-db</code></strong> only.</div></div><div class="docblock"><p>Simple key-value embedded database based on [<code>sled</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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#363" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/any.rs.html#363" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#363" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/database/any.rs.html#363" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3C()%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.unit.html">()</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-From%3C()%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#387" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#387" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CSledDbConfiguration%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="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-From%3CSledDbConfiguration%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#388" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#388" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#363" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/database/any.rs.html#363" 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.118/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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `any` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, any"><title>bdk::database::any - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module any</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">database</a></p><script>window.sidebarCurrent = {name: "any", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#25-388" 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="">any</a></span></h1><div class="docblock"><p>Runtime-checked database types</p>
+<p>This module provides the implementation of <a href="../../../bdk/database/any/enum.AnyDatabase.html" title="AnyDatabase"><code>AnyDatabase</code></a> which allows switching the
+inner <a href="../../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> type at runtime.</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>In this example, <code>wallet_memory</code> and <code>wallet_sled</code> have the same type of <code>Wallet<OfflineBlockchain, AnyDatabase></code>.</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">memory</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>().<span class="ident">into</span>();
+<span class="kw">let</span> <span class="ident">wallet_memory</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">AnyDatabase</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"..."</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">memory</span>)<span class="question-mark">?</span>;
+
+<span class="kw">let</span> <span class="ident">sled</span> <span class="op">=</span> <span class="ident">sled</span>::<span class="ident">open</span>(<span class="string">"my-database"</span>)<span class="question-mark">?</span>.<span class="ident">open_tree</span>(<span class="string">"default_tree"</span>)<span class="question-mark">?</span>.<span class="ident">into</span>();
+<span class="kw">let</span> <span class="ident">wallet_sled</span>: <span class="ident">OfflineWallet</span><span class="op"><</span><span class="ident">AnyDatabase</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Wallet</span>::<span class="ident">new_offline</span>(<span class="string">"..."</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">sled</span>)<span class="question-mark">?</span>;</pre></div>
+<p>When paired with the use of <a href="../../../bdk/database/trait.ConfigurableDatabase.html" title="ConfigurableDatabase"><code>ConfigurableDatabase</code></a>, it allows creating wallets with any
+database supported using a single line of code:</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">config</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="string">"..."</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">AnyDatabase</span>::<span class="ident">from_config</span>(<span class="kw-2">&</span><span class="ident">config</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="string">"..."</span>, <span class="prelude-val">None</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">database</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.SledDbConfiguration.html" title="bdk::database::any::SledDbConfiguration struct">SledDbConfiguration</a></td><td class="docblock-short"><p>Configuration type for a [<code>sled::Tree</code>] database</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.AnyBatch.html" title="bdk::database::any::AnyBatch enum">AnyBatch</a></td><td class="docblock-short"><p>Type that contains any of the <a href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="BatchDatabase::Batch"><code>BatchDatabase::Batch</code></a> types defined by the library</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.AnyDatabase.html" title="bdk::database::any::AnyDatabase enum">AnyDatabase</a></td><td class="docblock-short"><p>Type that can contain any of the <a href="../../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> types defined by the library</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.AnyDatabaseConfig.html" title="bdk::database::any::AnyDatabaseConfig enum">AnyDatabaseConfig</a></td><td class="docblock-short"><p>Type that can contain any of the database configurations defined by the library</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":[["AnyBatch","Type that contains any of the [`BatchDatabase::Batch`] types defined by the library"],["AnyDatabase","Type that can contain any of the [`Database`] types defined by the library"],["AnyDatabaseConfig","Type that can contain any of the database configurations defined by the library"]],"struct":[["SledDbConfiguration","Configuration type for a [`sled::Tree`] 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 `SledDbConfiguration` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SledDbConfiguration"><title>bdk::database::any::SledDbConfiguration - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct SledDbConfiguration</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.path">path</a><a href="#structfield.tree_name">tree_name</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-From%3CSledDbConfiguration%3E">From<SledDbConfiguration></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">any</a></p><script>window.sidebarCurrent = {name: "SledDbConfiguration", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/any.rs.html#342-347" 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">any</a>::<wbr><a class="struct" href="">SledDbConfiguration</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct SledDbConfiguration {
+ pub path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
+ pub tree_name: <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>Configuration type for a [<code>sled::Tree</code>] database</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.path" class="structfield small-section-header"><a href="#structfield.path" class="anchor field"></a><code>path: <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>Main directory of the db</p>
+</div><span id="structfield.tree_name" class="structfield small-section-header"><a href="#structfield.tree_name" class="anchor field"></a><code>tree_name: <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>Name of the database tree, a separated namespace for the data</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/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#341" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/any.rs.html#341" 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Deserialize%3C%27de%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#341" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../../../src/bdk/database/any.rs.html#341" 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.118/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
+</div></div><h3 id="impl-From%3CSledDbConfiguration%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="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code><a href="#impl-From%3CSledDbConfiguration%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#388" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#388" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Serialize" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#341" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/database/any.rs.html#341" 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.118/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/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-383" 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="../../bdk/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 any::<a class="enum" href="../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a>;</code></td></tr><tr><td><code>pub use any::<a class="enum" href="../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a>;</code></td></tr><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="any/index.html" title="bdk::database::any mod">any</a></td><td class="docblock-short"><p>Runtime-checked database types</p>
+</td></tr><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.ConfigurableDatabase.html" title="bdk::database::ConfigurableDatabase trait">ConfigurableDatabase</a></td><td class="docblock-short"><p>Trait for <a href="../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> types that can be created given a configuration</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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-566" 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 <a href="../../../bdk/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="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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-ConfigurableDatabase">ConfigurableDatabase</a><a href="#impl-Database">Database</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%3E">From<<MemoryDatabase as BatchDatabase>::Batch></a><a href="#impl-From%3CMemoryDatabase%3E">From<MemoryDatabase></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="../../../bdk/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="../../../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>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>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>pub 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>pub 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>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain and child number.</p>
+</div><h4 id="method.set_utxo" class="method hidden"><code>pub 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 <a href="../../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a></p>
+</div><h4 id="method.set_raw_tx" class="method hidden"><code>pub 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>pub 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain.</p>
+</div><h4 id="method.del_script_pubkey_from_path" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain and its child number.</p>
+</div><h4 id="method.del_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain 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>pub 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 <a href="../../../bdk/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>pub 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>pub 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>pub fn <a href="../../../bdk/database/trait.BatchOperations.html#tymethod.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain.</p>
+</div></div><h3 id="impl-ConfigurableDatabase" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/database/trait.ConfigurableDatabase.html" title="trait bdk::database::ConfigurableDatabase">ConfigurableDatabase</a> for <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href="#impl-ConfigurableDatabase" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/memory.rs.html#453-459" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config" class="type"><code>type <a href="../../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><div class='docblock'><p>Type that contains the configuration</p>
+</div><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="../../../bdk/database/trait.ConfigurableDatabase.html#tymethod.from_config" class="fnname">from_config</a>(_config: &Self::<a class="type" href="../../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/memory.rs.html#456-458" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create a new instance given a configuration</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>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain. <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>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.iter_script_pubkeys" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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 <a href="../../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a>s</p>
+</div><h4 id="method.iter_raw_txs" class="method hidden"><code>pub 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>pub fn <a href="../../../bdk/database/trait.Database.html#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>></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>pub 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> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 child number of a keychain.</p>
+</div><h4 id="method.get_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain and child number of a given script_pubkey</p>
+</div><h4 id="method.get_utxo" class="method hidden"><code>pub 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 <a href="../../../bdk/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>pub 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>pub 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>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.get_last_index" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#417-420" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Return the last defivation index for a keychain.</p>
+</div><h4 id="method.increment_last_index" class="method hidden"><code>pub fn <a href="../../../bdk/database/trait.Database.html#tymethod.increment_last_index" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 keychain and return 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>pub 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>pub 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><h3 id="impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%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="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-From%3C%3CMemoryDatabase%20as%20BatchDatabase%3E%3A%3ABatch%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#115-119" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <<a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a> as <a class="trait" href="../../../bdk/database/trait.BatchDatabase.html" title="trait bdk::database::BatchDatabase">BatchDatabase</a>>::<a class="type" href="../../../bdk/database/trait.BatchDatabase.html#associatedtype.Batch" title="type bdk::database::BatchDatabase::Batch">Batch</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#115-119" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CMemoryDatabase%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="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>> for <a class="enum" href="../../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-From%3CMemoryDatabase%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/database/any.rs.html#102" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(inner: <a class="struct" href="../../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a>) -> Self</code><a class="srclink" href="../../../src/bdk/database/any.rs.html#102" 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/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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":[["any","Runtime-checked database types"],["memory","In-memory ephemeral database"]],"trait":[["BatchDatabase","Trait for a database that supports batch operations"],["BatchOperations","Trait for operations that can be batched"],["ConfigurableDatabase","Trait for [`Database`] types that can be created given a configuration"],["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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#155-163" 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>;
+ pub 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> pub 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>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><a class="srclink" href="../../src/bdk/database/mod.rs.html#157" title="goto source code">[src]</a></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>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#160" title="goto source code">[src]</a></h3><div class="docblock"><p>Create a new batch container</p>
+</div><h3 id="tymethod.commit_batch" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#162" title="goto source code">[src]</a></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>type <a href="#associatedtype.Batch" class="type">Batch</a> = Batch</code></h4><h4 id="method.begin_batch" class="method hidden"><code>pub 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>pub 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="enum" href="../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-BatchDatabase" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#306-337" 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> = <a class="enum" href="../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code></h4><h4 id="method.begin_batch-1" class="method hidden"><code>pub 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/any.rs.html#309-315" title="goto source code">[src]</a></h4><h4 id="method.commit_batch-1" class="method hidden"><code>pub 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/any.rs.html#316-336" title="goto source code">[src]</a></h4></div><h3 id="impl-BatchDatabase-1" 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-1" 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-3" class="type"><code>type <a href="#associatedtype.Batch-3" class="type">Batch</a> = Self</code></h4><h4 id="method.begin_batch-2" class="method hidden"><code>pub fn <a href="#method.begin_batch-2" 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-2" class="method hidden"><code>pub fn <a href="#method.commit_batch-2" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#59-100" 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 {
+ pub fn <a href="#tymethod.set_script_pubkey" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub 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> pub 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> pub fn <a href="#tymethod.set_tx" class="fnname">set_tx</a>(<br> &mut self, <br> transaction: &<a class="struct" href="../../bdk/struct.TransactionDetails.html" title="struct bdk::TransactionDetails">TransactionDetails</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> pub fn <a href="#tymethod.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub fn <a href="#tymethod.del_script_pubkey_from_path" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub fn <a href="#tymethod.del_utxo" class="fnname">del_utxo</a>(<br> &mut self, <br> outpoint: &OutPoint<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.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> pub fn <a href="#tymethod.del_raw_tx" class="fnname">del_raw_tx</a>(<br> &mut self, <br> txid: &Txid<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><Transaction>, <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>>;
+<div class="item-spacer"></div> pub 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> pub fn <a href="#tymethod.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 <a href="../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> type and
+the <a href="../../bdk/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>pub fn <a href="#tymethod.set_script_pubkey" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/mod.rs.html#61-66" title="goto source code">[src]</a></h3><div class="docblock"><p>Store a script_pubkey along with its keychain and child number.</p>
+</div><h3 id="tymethod.set_utxo" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#68" title="goto source code">[src]</a></h3><div class="docblock"><p>Store a <a href="../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a></p>
+</div><h3 id="tymethod.set_raw_tx" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#70" title="goto source code">[src]</a></h3><div class="docblock"><p>Store a raw transaction</p>
+</div><h3 id="tymethod.set_tx" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#72" title="goto source code">[src]</a></h3><div class="docblock"><p>Store the metadata of a transaction</p>
+</div><h3 id="tymethod.set_last_index" class="method"><code>pub fn <a href="#tymethod.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#74" title="goto source code">[src]</a></h3><div class="docblock"><p>Store the last derivation index for a given keychain.</p>
+</div><h3 id="tymethod.del_script_pubkey_from_path" class="method"><code>pub fn <a href="#tymethod.del_script_pubkey_from_path" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/mod.rs.html#77-81" title="goto source code">[src]</a></h3><div class="docblock"><p>Delete a script_pubkey given the keychain and its child number.</p>
+</div><h3 id="tymethod.del_path_from_script_pubkey" class="method"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#84-87" title="goto source code">[src]</a></h3><div class="docblock"><p>Delete the data related to a specific script_pubkey, meaning the keychain and the child
+number.</p>
+</div><h3 id="tymethod.del_utxo" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#89" title="goto source code">[src]</a></h3><div class="docblock"><p>Delete a <a href="../../bdk/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>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#91" title="goto source code">[src]</a></h3><div class="docblock"><p>Delete a raw transaction given its [<code>Txid</code>]</p>
+</div><h3 id="tymethod.del_tx" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#93-97" title="goto source code">[src]</a></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>pub fn <a href="#tymethod.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#99" title="goto source code">[src]</a></h3><div class="docblock"><p>Delete the last derivation index for a keychain.</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>pub fn <a href="#method.set_script_pubkey" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#193" title="goto source code">[src]</a></h4><h4 id="method.set_utxo" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.set_raw_tx" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.set_tx" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.set_last_index" class="method hidden"><code>pub fn <a href="#method.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#193" title="goto source code">[src]</a></h4><h4 id="method.del_script_pubkey_from_path" class="method hidden"><code>pub fn <a href="#method.del_script_pubkey_from_path" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#193" title="goto source code">[src]</a></h4><h4 id="method.del_path_from_script_pubkey" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#193" title="goto source code">[src]</a></h4><h4 id="method.del_utxo" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.del_raw_tx" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.del_tx" class="method hidden"><code>pub 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#193" title="goto source code">[src]</a></h4><h4 id="method.del_last_index" class="method hidden"><code>pub fn <a href="#method.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#193" 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>pub fn <a href="#method.set_script_pubkey" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#203" title="goto source code">[src]</a></h4><h4 id="method.set_utxo-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.set_raw_tx-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.set_tx-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.set_last_index-1" class="method hidden"><code>pub fn <a href="#method.set_last_index" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#203" title="goto source code">[src]</a></h4><h4 id="method.del_script_pubkey_from_path-1" class="method hidden"><code>pub fn <a href="#method.del_script_pubkey_from_path" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#203" title="goto source code">[src]</a></h4><h4 id="method.del_path_from_script_pubkey-1" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#203" title="goto source code">[src]</a></h4><h4 id="method.del_utxo-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.del_raw_tx-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.del_tx-1" class="method hidden"><code>pub 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#203" title="goto source code">[src]</a></h4><h4 id="method.del_last_index-1" class="method hidden"><code>pub fn <a href="#method.del_last_index" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#203" 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="enum" href="../../bdk/database/any/enum.AnyBatch.html" title="enum bdk::database::any::AnyBatch">AnyBatch</a></code><a href="#impl-BatchOperations" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#253-304" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.set_script_pubkey-2" class="method hidden"><code>pub fn <a href="#method.set_script_pubkey-2" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/any.rs.html#254-261" title="goto source code">[src]</a></h4><h4 id="method.set_utxo-2" class="method hidden"><code>pub 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/any.rs.html#262-264" title="goto source code">[src]</a></h4><h4 id="method.set_raw_tx-2" class="method hidden"><code>pub 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/any.rs.html#265-267" title="goto source code">[src]</a></h4><h4 id="method.set_tx-2" class="method hidden"><code>pub 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/any.rs.html#268-270" title="goto source code">[src]</a></h4><h4 id="method.set_last_index-2" class="method hidden"><code>pub fn <a href="#method.set_last_index-2" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#271-273" title="goto source code">[src]</a></h4><h4 id="method.del_script_pubkey_from_path-2" class="method hidden"><code>pub fn <a href="#method.del_script_pubkey_from_path-2" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/any.rs.html#275-281" title="goto source code">[src]</a></h4><h4 id="method.del_path_from_script_pubkey-2" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#282-287" title="goto source code">[src]</a></h4><h4 id="method.del_utxo-2" class="method hidden"><code>pub 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/any.rs.html#288-290" title="goto source code">[src]</a></h4><h4 id="method.del_raw_tx-2" class="method hidden"><code>pub 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/any.rs.html#291-293" title="goto source code">[src]</a></h4><h4 id="method.del_tx-2" class="method hidden"><code>pub 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/any.rs.html#294-300" title="goto source code">[src]</a></h4><h4 id="method.del_last_index-2" class="method hidden"><code>pub fn <a href="#method.del_last_index-2" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#301-303" title="goto source code">[src]</a></h4></div><h3 id="impl-BatchOperations-1" class="impl"><code class="in-band">impl BatchOperations for <a class="enum" href="../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-BatchOperations-1" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#122-186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.set_script_pubkey-3" class="method hidden"><code>pub fn <a href="#method.set_script_pubkey-3" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/any.rs.html#123-137" title="goto source code">[src]</a></h4><h4 id="method.set_utxo-3" class="method hidden"><code>pub fn <a href="#method.set_utxo-3" 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/any.rs.html#138-140" title="goto source code">[src]</a></h4><h4 id="method.set_raw_tx-3" class="method hidden"><code>pub fn <a href="#method.set_raw_tx-3" 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/any.rs.html#141-143" title="goto source code">[src]</a></h4><h4 id="method.set_tx-3" class="method hidden"><code>pub fn <a href="#method.set_tx-3" 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/any.rs.html#144-146" title="goto source code">[src]</a></h4><h4 id="method.set_last_index-3" class="method hidden"><code>pub fn <a href="#method.set_last_index-3" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#147-149" title="goto source code">[src]</a></h4><h4 id="method.del_script_pubkey_from_path-3" class="method hidden"><code>pub fn <a href="#method.del_script_pubkey_from_path-3" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/any.rs.html#151-163" title="goto source code">[src]</a></h4><h4 id="method.del_path_from_script_pubkey-3" class="method hidden"><code>pub fn <a href="#method.del_path_from_script_pubkey-3" 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#164-169" title="goto source code">[src]</a></h4><h4 id="method.del_utxo-3" class="method hidden"><code>pub fn <a href="#method.del_utxo-3" 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/any.rs.html#170-172" title="goto source code">[src]</a></h4><h4 id="method.del_raw_tx-3" class="method hidden"><code>pub fn <a href="#method.del_raw_tx-3" 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/any.rs.html#173-175" title="goto source code">[src]</a></h4><h4 id="method.del_tx-3" class="method hidden"><code>pub fn <a href="#method.del_tx-3" 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/any.rs.html#176-182" title="goto source code">[src]</a></h4><h4 id="method.del_last_index-3" class="method hidden"><code>pub fn <a href="#method.del_last_index-3" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#183-185" title="goto source code">[src]</a></h4></div><h3 id="impl-BatchOperations-2" 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-2" 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-4" class="method hidden"><code>pub fn <a href="#method.set_script_pubkey-4" class="fnname">set_script_pubkey</a>(<br> &mut self, <br> script: &Script, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-4" class="method hidden"><code>pub fn <a href="#method.set_utxo-4" 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-4" class="method hidden"><code>pub fn <a href="#method.set_raw_tx-4" 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-4" class="method hidden"><code>pub fn <a href="#method.set_tx-4" 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-4" class="method hidden"><code>pub fn <a href="#method.set_last_index-4" class="fnname">set_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-4" class="method hidden"><code>pub fn <a href="#method.del_script_pubkey_from_path-4" class="fnname">del_script_pubkey_from_path</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-4" class="method hidden"><code>pub fn <a href="#method.del_path_from_script_pubkey-4" 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-4" class="method hidden"><code>pub fn <a href="#method.del_utxo-4" 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-4" class="method hidden"><code>pub fn <a href="#method.del_raw_tx-4" 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-4" class="method hidden"><code>pub fn <a href="#method.del_tx-4" 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-4" class="method hidden"><code>pub fn <a href="#method.del_last_index-4" class="fnname">del_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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 `ConfigurableDatabase` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ConfigurableDatabase"><title>bdk::database::ConfigurableDatabase - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait ConfigurableDatabase</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.Config">Config</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.from_config">from_config</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ConfigurableDatabase-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: "ConfigurableDatabase", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#166-172" 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="">ConfigurableDatabase</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait ConfigurableDatabase: <a class="trait" href="../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
+ type <a href="#associatedtype.Config" class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
+ pub fn <a href="#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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>>;
+}</pre></div><div class="docblock"><p>Trait for <a href="../../bdk/database/trait.Database.html" title="Database"><code>Database</code></a> types that can be created given a configuration</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.Config" class="method"><code>type <a href="#associatedtype.Config" class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></code><a class="srclink" href="../../src/bdk/database/mod.rs.html#168" title="goto source code">[src]</a></h3><div class="docblock"><p>Type that contains the configuration</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.from_config" class="method"><code>pub fn <a href="#tymethod.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/mod.rs.html#171" title="goto source code">[src]</a></h3><div class="docblock"><p>Create a new instance given a configuration</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-ConfigurableDatabase-for-Tree" class="impl"><code class="in-band">impl <a class="trait" href="../../bdk/database/trait.ConfigurableDatabase.html" title="trait bdk::database::ConfigurableDatabase">ConfigurableDatabase</a> for Tree</code><a href="#impl-ConfigurableDatabase-for-Tree" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#350-356" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config-1" class="type"><code>type <a href="#associatedtype.Config" class="type">Config</a> = <a class="struct" href="../../bdk/database/any/struct.SledDbConfiguration.html" title="struct bdk::database::any::SledDbConfiguration">SledDbConfiguration</a></code></h4><h4 id="method.from_config" class="method hidden"><code>pub fn <a href="#method.from_config" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/any.rs.html#353-355" 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-ConfigurableDatabase" class="impl"><code class="in-band">impl ConfigurableDatabase for <a class="enum" href="../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-ConfigurableDatabase" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#373-385" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config-2" class="type"><code>type <a href="#associatedtype.Config-2" class="type">Config</a> = <a class="enum" href="../../bdk/database/any/enum.AnyDatabaseConfig.html" title="enum bdk::database::any::AnyDatabaseConfig">AnyDatabaseConfig</a></code></h4><h4 id="method.from_config-1" class="method hidden"><code>pub fn <a href="#method.from_config-1" class="fnname">from_config</a>(config: &Self::<a class="type" href="../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/any.rs.html#376-384" title="goto source code">[src]</a></h4></div><h3 id="impl-ConfigurableDatabase-1" class="impl"><code class="in-band">impl ConfigurableDatabase for <a class="struct" href="../../bdk/database/memory/struct.MemoryDatabase.html" title="struct bdk::database::memory::MemoryDatabase">MemoryDatabase</a></code><a href="#impl-ConfigurableDatabase-1" class="anchor"></a><a class="srclink" href="../../src/bdk/database/memory.rs.html#453-459" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Config-3" class="type"><code>type <a href="#associatedtype.Config-3" class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><h4 id="method.from_config-2" class="method hidden"><code>pub fn <a href="#method.from_config-2" class="fnname">from_config</a>(_config: &Self::<a class="type" href="../../bdk/database/trait.ConfigurableDatabase.html#associatedtype.Config" title="type bdk::database::ConfigurableDatabase::Config">Config</a>) -> <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/database/memory.rs.html#456-458" 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.ConfigurableDatabase.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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#105-150" 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> {
+ pub 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub fn <a href="#tymethod.iter_script_pubkeys" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub 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> pub 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> pub 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> pub fn <a href="#tymethod.get_script_pubkey_from_path" class="fnname">get_script_pubkey_from_path</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub 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> pub 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> pub 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> pub fn <a href="#tymethod.get_last_index" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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> pub fn <a href="#tymethod.increment_last_index" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#111-115" title="goto source code">[src]</a></h3><div class="docblock"><p>Read and checks the descriptor checksum for a given keychain.</p>
+<p>Should return <a href="../../bdk/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>pub fn <a href="#tymethod.iter_script_pubkeys" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#118" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the list of script_pubkeys</p>
+</div><h3 id="tymethod.iter_utxos" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#120" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the list of <a href="../../bdk/struct.UTXO.html" title="UTXO"><code>UTXO</code></a>s</p>
+</div><h3 id="tymethod.iter_raw_txs" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#122" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the list of raw transactions</p>
+</div><h3 id="tymethod.iter_txs" class="method"><code>pub 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>></code><a class="srclink" href="../../src/bdk/database/mod.rs.html#124" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the list of transactions metadata</p>
+</div><h3 id="tymethod.get_script_pubkey_from_path" class="method"><code>pub fn <a href="#tymethod.get_script_pubkey_from_path" class="fnname">get_script_pubkey_from_path</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/mod.rs.html#127-131" title="goto source code">[src]</a></h3><div class="docblock"><p>Fetch a script_pubkey given the child number of a keychain.</p>
+</div><h3 id="tymethod.get_path_from_script_pubkey" class="method"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#133-136" title="goto source code">[src]</a></h3><div class="docblock"><p>Fetch the keychain and child number of a given script_pubkey</p>
+</div><h3 id="tymethod.get_utxo" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#138" title="goto source code">[src]</a></h3><div class="docblock"><p>Fetch a <a href="../../bdk/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>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#140" title="goto source code">[src]</a></h3><div class="docblock"><p>Fetch a raw transaction given its [<code>Txid</code>]</p>
+</div><h3 id="tymethod.get_tx" class="method"><code>pub 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><a class="srclink" href="../../src/bdk/database/mod.rs.html#142" title="goto source code">[src]</a></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>pub fn <a href="#tymethod.get_last_index" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#144" title="goto source code">[src]</a></h3><div class="docblock"><p>Return the last defivation index for a keychain.</p>
+</div><h3 id="tymethod.increment_last_index" class="method"><code>pub fn <a href="#tymethod.increment_last_index" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/mod.rs.html#149" title="goto source code">[src]</a></h3><div class="docblock"><p>Increment the last derivation index for a keychain and return 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>pub 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub fn <a href="#method.iter_script_pubkeys" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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>pub 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>pub fn <a href="#method.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>></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>pub fn <a href="#method.get_script_pubkey_from_path" class="fnname">get_script_pubkey_from_path</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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>pub 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>pub 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>pub fn <a href="#method.get_last_index" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#344-356" title="goto source code">[src]</a></h4><h4 id="method.increment_last_index" class="method hidden"><code>pub fn <a href="#method.increment_last_index" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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="enum" href="../../bdk/database/any/enum.AnyDatabase.html" title="enum bdk::database::any::AnyDatabase">AnyDatabase</a></code><a href="#impl-Database" class="anchor"></a><a class="srclink" href="../../src/bdk/database/any.rs.html#188-251" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.check_descriptor_checksum-1" class="method hidden"><code>pub 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#189-201" title="goto source code">[src]</a></h4><h4 id="method.iter_script_pubkeys-1" class="method hidden"><code>pub fn <a href="#method.iter_script_pubkeys-1" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#203-205" title="goto source code">[src]</a></h4><h4 id="method.iter_utxos-1" class="method hidden"><code>pub 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/any.rs.html#206-208" title="goto source code">[src]</a></h4><h4 id="method.iter_raw_txs-1" class="method hidden"><code>pub 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/any.rs.html#209-211" title="goto source code">[src]</a></h4><h4 id="method.iter_txs-1" class="method hidden"><code>pub fn <a href="#method.iter_txs-1" 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>></code><a class="srclink" href="../../src/bdk/database/any.rs.html#212-214" title="goto source code">[src]</a></h4><h4 id="method.get_script_pubkey_from_path-1" class="method hidden"><code>pub fn <a href="#method.get_script_pubkey_from_path-1" class="fnname">get_script_pubkey_from_path</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../src/bdk/database/any.rs.html#216-228" title="goto source code">[src]</a></h4><h4 id="method.get_path_from_script_pubkey-1" class="method hidden"><code>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#229-234" title="goto source code">[src]</a></h4><h4 id="method.get_utxo-1" class="method hidden"><code>pub 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/any.rs.html#235-237" title="goto source code">[src]</a></h4><h4 id="method.get_raw_tx-1" class="method hidden"><code>pub 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/any.rs.html#238-240" title="goto source code">[src]</a></h4><h4 id="method.get_tx-1" class="method hidden"><code>pub 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/any.rs.html#241-243" title="goto source code">[src]</a></h4><h4 id="method.get_last_index-1" class="method hidden"><code>pub fn <a href="#method.get_last_index-1" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#244-246" title="goto source code">[src]</a></h4><h4 id="method.increment_last_index-1" class="method hidden"><code>pub fn <a href="#method.increment_last_index-1" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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/any.rs.html#248-250" title="goto source code">[src]</a></h4></div><h3 id="impl-Database-1" 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-1" 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-2" class="method hidden"><code>pub fn <a href="#method.check_descriptor_checksum-2" 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-2" class="method hidden"><code>pub fn <a href="#method.iter_script_pubkeys-2" class="fnname">iter_script_pubkeys</a>(<br> &self, <br> keychain: <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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-2" class="method hidden"><code>pub fn <a href="#method.iter_utxos-2" 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-2" class="method hidden"><code>pub fn <a href="#method.iter_raw_txs-2" 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-2" class="method hidden"><code>pub fn <a href="#method.iter_txs-2" 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>></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-2" class="method hidden"><code>pub fn <a href="#method.get_script_pubkey_from_path-2" class="fnname">get_script_pubkey_from_path</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-2" class="method hidden"><code>pub fn <a href="#method.get_path_from_script_pubkey-2" 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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-2" class="method hidden"><code>pub fn <a href="#method.get_utxo-2" 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-2" class="method hidden"><code>pub fn <a href="#method.get_raw_tx-2" 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-2" class="method hidden"><code>pub fn <a href="#method.get_tx-2" 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-2" class="method hidden"><code>pub fn <a href="#method.get_last_index-2" class="fnname">get_last_index</a>(<br> &self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#417-420" title="goto source code">[src]</a></h4><h4 id="method.increment_last_index-2" class="method hidden"><code>pub fn <a href="#method.increment_last_index-2" class="fnname">increment_last_index</a>(<br> &mut self, <br> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-126" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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.ShSortedMulti">ShSortedMulti</a><a href="#variant.ShWpkh">ShWpkh</a><a href="#variant.ShWsh">ShWsh</a><a href="#variant.ShWshSortedMulti">ShWshSortedMulti</a><a href="#variant.Wpkh">Wpkh</a><a href="#variant.Wsh">Wsh</a><a href="#variant.WshSortedMulti">WshSortedMulti</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.get_satisfication">get_satisfication</a><a href="#method.max_satisfaction_weight">max_satisfaction_weight</a><a href="#method.parse_descriptor">parse_descriptor</a><a href="#method.sanity_check">sanity_check</a><a href="#method.satisfy">satisfy</a><a href="#method.script_code">script_code</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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, Bare>),
+ 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>>),
+ ShSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>),
+ WshSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>),
+ ShWshSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>Bare(<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Bare>)</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="../../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>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>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><div id="variant.ShSortedMulti" class="variant small-section-header"><a href="#variant.ShSortedMulti" class="anchor field"></a><code>ShSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>)</code></div><div class="docblock"><p>Sortedmulti under P2SH</p>
+</div><div id="variant.WshSortedMulti" class="variant small-section-header"><a href="#variant.WshSortedMulti" class="anchor field"></a><code>WshSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class="docblock"><p>Sortedmulti under P2WSH</p>
+</div><div id="variant.ShWshSortedMulti" class="variant small-section-header"><a href="#variant.ShWshSortedMulti" class="anchor field"></a><code>ShWshSortedMulti(<a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, <a class="enum" href="../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>)</code></div><div class="docblock"><p>Sortedmulti under P2SH-P2WSH</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>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><h4 id="method.sanity_check" class="method"><code>pub fn <a href="#method.sanity_check" class="fnname">sanity_check</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.unit.html">()</a>, Error></code></h4><div class="docblock"><p>Whether the descriptor is safe
+Checks whether all the spend paths in the descriptor are possible
+on the bitcoin network under the current standardness and consensus rules
+Also checks whether the descriptor requires signauture on all spend paths
+And whether the script is malleable.
+In general, all the guarantees of miniscript hold only for safe scripts.
+All the analysis guarantees of miniscript only hold safe scripts.
+The signer may not be able to find satisfactions even if one exists</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>, </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><ToPkCtx>(<br> &self, <br> network: Network, <br> to_pk_ctx: ToPkCtx<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Address> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Computes the Bitcoin address of the descriptor, if one exists
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait [trait.ToPublicKey]</p>
+</div><h4 id="method.script_pubkey" class="method"><code>pub fn <a href="#method.script_pubkey" class="fnname">script_pubkey</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Computes the scriptpubkey of the descriptor
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a></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><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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).
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a></p>
+</div><h4 id="method.witness_script" class="method"><code>pub fn <a href="#method.witness_script" class="fnname">witness_script</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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.
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a></p>
+</div><h4 id="method.get_satisfication" class="method"><code>pub fn <a href="#method.get_satisfication" class="fnname">get_satisfication</a><ToPkCtx, S>(<br> &self, <br> satisfier: S, <br> to_pk_ctx: ToPkCtx<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="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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, Script<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> S: Satisfier<ToPkCtx, Pk>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Returns satisfying witness and scriptSig to spend an
+output controlled by the given descriptor if it possible to
+construct one using the satisfier S.
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a></p>
+</div><h4 id="method.satisfy" class="method"><code>pub fn <a href="#method.satisfy" class="fnname">satisfy</a><ToPkCtx, S>(<br> &self, <br> txin: &mut TxIn, <br> satisfier: S, <br> to_pk_ctx: ToPkCtx<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>, Error> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> S: Satisfier<ToPkCtx, Pk>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </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><ToPkCtx>(<br> &self, <br> to_pk_ctx: ToPkCtx<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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><h4 id="method.script_code" class="method"><code>pub fn <a href="#method.script_code" class="fnname">script_code</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Get the <code>scriptCode</code> of a transaction output.</p>
+<p>The <code>scriptCode</code> is the Script of the previous transaction output being serialized in the
+sighash when evaluating a <code>CHECKSIG</code> & co. OP code.
+<code>to_pk_ctx</code> denotes the ToPkCtx required for deriving bitcoin::PublicKey
+from MiniscriptKey using <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a>.
+If MiniscriptKey is already is [bitcoin::PublicKey], then the context
+would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]</p>
+<p>In general, this is defined by generic for the trait <a href="../../bdk/descriptor/trait.ToPublicKey.html" title="ToPublicKey">ToPublicKey</a></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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>></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>(<br> &self, <br> child_number: ChildNumber<br>) -> <a class="enum" href="../../bdk/descriptor/enum.Descriptor.html" title="enum bdk::descriptor::Descriptor">Descriptor</a><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>></code></h4><div class="docblock"><p>Derives all wildcard keys in the descriptor using the supplied <code>child_number</code></p>
+</div><h4 id="method.parse_descriptor" class="method"><code>pub fn <a href="#method.parse_descriptor" class="fnname">parse_descriptor</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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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><div class="docblock"><p>Parse a descriptor that may contain secret keys</p>
+<p>Internally turns every secret key found into the corresponding public key and then returns a
+a descriptor that only contains public keys and a map to lookup the secret key given a public key.</p>
+</div><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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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 class="docblock"><p>Serialize a descriptor to string with its secret keys</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> 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>pub 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>pub 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#128-130" 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>pub 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>pub 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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>></code><a href="#impl-ExtractPolicy" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/policy.rs.html#846-884" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.extract_policy" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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#847-883" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Extract the spending <a href="../../bdk/descriptor/policy/index.html" title="policy"><code>policy</code></a></p>
+</div></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/traits/trait.FromStr.html" title="trait core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/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>pub fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/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/traits/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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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>pub 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>pub fn <a href="#method.lift" class="fnname">lift</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Policy<Pk>, Error></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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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>pub 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>pub 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>pub 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>pub 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>pub 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>pub 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>pub 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-ExtScriptContext">ExtScriptContext</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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
+To be used as P2SH scripts
+For creation of Bare scriptpubkeys, construct the Miniscript
+under <code>Bare</code> 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>pub 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>pub 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#128-130" 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>pub 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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#209-211" 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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#959-961" 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>pub 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#978-980" 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>pub 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#996-998" 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>pub 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#1015-1017" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_terminal_non_malleable" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/keys/trait.ScriptContext.html#tymethod.check_terminal_non_malleable">Read more</a></p>
+</div><h4 id="method.check_witness" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the given satisfaction is valid under the ScriptContext
+For example, segwit satisfactions may fail if the witness len is more
+3600 or number of stack elements are more than 100. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_witness">Read more</a></p>
+</div><h4 id="method.check_global_consensus_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 under the current consensus rules.
+Or some of the script resource limits may have been exceeded.
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+uncompressed public keys are non-standard and thus invalid.
+In LegacyP2SH context, scripts above 520 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_consensus_validity">Read more</a></p>
+</div><h4 id="method.check_local_consensus_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Consensus rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path(Legacy/Segwitv0) may require more than 201 opcodes. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_consensus_validity">Read more</a></p>
+</div><h4 id="method.check_local_policy_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Policy rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path in Legacy context scriptSig more
+than 1650 bytes <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_policy_validity">Read more</a></p>
+</div><h4 id="method.max_satisfaction_size" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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, the size of a satifaction witness may slightly differ.</p>
+</div><h4 id="method.check_global_policy_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 script resource limits
+may have been exceeded under the current bitcoin core policy rules
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them. (unless explicitly disabled by non-standard flag)
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+scripts over 3600 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_policy_validity">Read more</a></p>
+</div><h4 id="method.check_global_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules that are not based
+satisfaction <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_validity">Read more</a></p>
+</div><h4 id="method.check_local_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules including the
+ones for satisfaction <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_validity">Read more</a></p>
+</div><h4 id="method.top_level_type_check" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the top-level is type B</p>
+</div><h4 id="method.other_top_level_checks" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Other top level checks that are context specific</p>
+</div><h4 id="method.top_level_checks" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(ms: &<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/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> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check top level consensus rules.</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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-ExtScriptContext" class="impl"><code class="in-band">impl<Ctx> <a class="trait" href="../../bdk/keys/trait.ExtScriptContext.html" title="trait bdk::keys::ExtScriptContext">ExtScriptContext</a> for Ctx <span class="where fmt-newline">where<br> Ctx: 'static + <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>, </span></code><a href="#impl-ExtScriptContext" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#166-174" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_enum" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#tymethod.as_enum" class="fnname">as_enum</a>() -> <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#167-173" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a> as a <a href="../../bdk/keys/enum.ScriptContextEnum.html" title="ScriptContextEnum"><code>ScriptContextEnum</code></a></p>
+</div><h4 id="method.is_legacy" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#method.is_legacy" class="fnname">is_legacy</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#156-158" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Legacy.html"><code>Legacy</code></a></p>
+</div><h4 id="method.is_segwit_v0" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#method.is_segwit_v0" class="fnname">is_segwit_v0</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#161-163" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Segwitv0.html"><code>Segwitv0</code></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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-ExtScriptContext">ExtScriptContext</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>pub 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>pub 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#128-130" 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>pub 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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#209-211" 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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#959-961" 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>pub 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#978-980" 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>pub 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#996-998" 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>pub 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#1015-1017" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_terminal_non_malleable" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/keys/trait.ScriptContext.html#tymethod.check_terminal_non_malleable">Read more</a></p>
+</div><h4 id="method.check_witness" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the given satisfaction is valid under the ScriptContext
+For example, segwit satisfactions may fail if the witness len is more
+3600 or number of stack elements are more than 100. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_witness">Read more</a></p>
+</div><h4 id="method.check_global_consensus_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 under the current consensus rules.
+Or some of the script resource limits may have been exceeded.
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+uncompressed public keys are non-standard and thus invalid.
+In LegacyP2SH context, scripts above 520 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_consensus_validity">Read more</a></p>
+</div><h4 id="method.check_local_consensus_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Consensus rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path(Legacy/Segwitv0) may require more than 201 opcodes. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_consensus_validity">Read more</a></p>
+</div><h4 id="method.check_global_policy_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 script resource limits
+may have been exceeded under the current bitcoin core policy rules
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them. (unless explicitly disabled by non-standard flag)
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+scripts over 3600 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments. <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_policy_validity">Read more</a></p>
+</div><h4 id="method.check_local_policy_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Policy rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path in Legacy context scriptSig more
+than 1650 bytes <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_policy_validity">Read more</a></p>
+</div><h4 id="method.max_satisfaction_size" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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, the size of a satifaction witness may slightly differ.</p>
+</div><h4 id="method.check_global_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules that are not based
+satisfaction <a href="../../bdk/keys/trait.ScriptContext.html#method.check_global_validity">Read more</a></p>
+</div><h4 id="method.check_local_validity" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules including the
+ones for satisfaction <a href="../../bdk/keys/trait.ScriptContext.html#method.check_local_validity">Read more</a></p>
+</div><h4 id="method.top_level_type_check" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the top-level is type B</p>
+</div><h4 id="method.other_top_level_checks" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Other top level checks that are context specific</p>
+</div><h4 id="method.top_level_checks" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ScriptContext.html#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(ms: &<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/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> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check top level consensus rules.</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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-ExtScriptContext" class="impl"><code class="in-band">impl<Ctx> <a class="trait" href="../../bdk/keys/trait.ExtScriptContext.html" title="trait bdk::keys::ExtScriptContext">ExtScriptContext</a> for Ctx <span class="where fmt-newline">where<br> Ctx: 'static + <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>, </span></code><a href="#impl-ExtScriptContext" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#166-174" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_enum" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#tymethod.as_enum" class="fnname">as_enum</a>() -> <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#167-173" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a> as a <a href="../../bdk/keys/enum.ScriptContextEnum.html" title="ScriptContextEnum"><code>ScriptContextEnum</code></a></p>
+</div><h4 id="method.is_legacy" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#method.is_legacy" class="fnname">is_legacy</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#156-158" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Legacy.html"><code>Legacy</code></a></p>
+</div><h4 id="method.is_segwit_v0" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ExtScriptContext.html#method.is_segwit_v0" class="fnname">is_segwit_v0</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#161-163" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Segwitv0.html"><code>Segwitv0</code></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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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.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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>),
+ 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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>),
+}</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="../../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>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="../../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>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>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>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>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>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 <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="../../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>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>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>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>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>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>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>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>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>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>)</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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>)</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.encode" class="method"><code>pub fn <a href="#method.encode" class="fnname">encode</a><ToPkCtx>(&self, builder: Builder, to_pk_ctx: ToPkCtx) -> Builder <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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></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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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>pub 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#128-130" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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>pub 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 class='docblock hidden'><p>Extract a structure from Tree representation</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="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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub fn <a href="#method.lift" class="fnname">lift</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Policy<Pk>, Error></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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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>pub 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>pub 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>pub 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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/keys/trait.ScriptContext.html" title="trait bdk::keys::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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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.Hex">Hex</a><a href="#variant.InvalidDescriptorCharacter">InvalidDescriptorCharacter</a><a href="#variant.InvalidHDKeyPath">InvalidHDKeyPath</a><a href="#variant.Key">Key</a><a href="#variant.Miniscript">Miniscript</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%3CKeyError%3E">From<KeyError></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-60" 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 {
+ InvalidHDKeyPath,
+ Key(<a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>),
+ Policy(<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>),
+ InvalidDescriptorCharacter(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>),
+ 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.InvalidHDKeyPath" class="variant small-section-header"><a href="#variant.InvalidHDKeyPath" class="anchor field"></a><code>InvalidHDKeyPath</code></div><div class="docblock"><p>Invalid HD Key path, such as having a wildcard but a length != 1</p>
+</div><div id="variant.Key" class="variant small-section-header"><a href="#variant.Key" class="anchor field"></a><code>Key(<a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>)</code></div><div class="docblock"><p>Error thrown while working with <a href="../../../bdk/keys/index.html"><code>keys</code></a></p>
+</div><div id="variant.Policy" class="variant small-section-header"><a href="#variant.Policy" class="anchor field"></a><code>Policy(<a class="enum" href="../../../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div class="docblock"><p>Error while extracting and manipulating policies</p>
+</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 class="docblock"><p>Invalid character found in the descriptor checksum</p>
+</div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code>BIP32(Error)</code></div><div class="docblock"><p>BIP32 error</p>
+</div><div id="variant.Base58" class="variant small-section-header"><a href="#variant.Base58" class="anchor field"></a><code>Base58(Error)</code></div><div class="docblock"><p>Error during base58 decoding</p>
+</div><div id="variant.PK" class="variant small-section-header"><a href="#variant.PK" class="anchor field"></a><code>PK(Error)</code></div><div class="docblock"><p>Key-related error</p>
+</div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code>Miniscript(Error)</code></div><div class="docblock"><p>Miniscript error</p>
+</div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code>Hex(Error)</code></div><div class="docblock"><p>Hex decoding error</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/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>pub 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#72-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#73-75" 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#78" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#165" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#165" 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/descriptor/error.rs.html#80" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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/descriptor/error.rs.html#80" 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/descriptor/error.rs.html#81" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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/descriptor/error.rs.html#81" 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/descriptor/error.rs.html#82" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>pub 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/descriptor/error.rs.html#82" 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/descriptor/error.rs.html#83" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-5" class="method hidden"><code>pub 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/descriptor/error.rs.html#83" 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/descriptor/error.rs.html#84" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-6" class="method hidden"><code>pub 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/descriptor/error.rs.html#84" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CKeyError%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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</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%3CKeyError%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/error.rs.html#62-70" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(key_error: <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</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/error.rs.html#63-69" 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/descriptor/error.rs.html#85" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-7" class="method hidden"><code>pub 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/descriptor/error.rs.html#85" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-8" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-85" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-777" 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><tr class="module-item"><td><a class="mod" href="template/index.html" title="bdk::descriptor::template mod">template</a></td><td class="docblock-short"><p>Descriptor templates</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
+To be used as P2SH scripts
+For creation of Bare scriptpubkeys, construct the Miniscript
+under <code>Bare</code> 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 <a href="../../bdk/descriptor/enum.Descriptor.html" title="Descriptor"><code>Descriptor</code></a>s to add a method to extract the spending <a href="../../bdk/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="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"><p>The ScriptContext for Miniscript. Additional type information associated with
+miniscript that is used for carrying out checks that dependent on the
+context under which the script is used.
+For example, disallowing uncompressed keys in Segwit context</p>
+</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
+The trait relies on Copy trait because in all practical usecases <code>ToPkCtx</code>
+should contain references to objects which should be cheap to <code>Copy</code>.</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.ToWalletDescriptor.html" title="bdk::descriptor::ToWalletDescriptor trait">ToWalletDescriptor</a></td><td class="docblock-short"><p>Trait for types which can be converted into an <a href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="ExtendedDescriptor"><code>ExtendedDescriptor</code></a> and a <a href="../../bdk/descriptor/type.KeyMap.html" title="KeyMap"><code>KeyMap</code></a> usable by a wallet in a specific [<code>Network</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.ExtendedDescriptor.html" title="bdk::descriptor::ExtendedDescriptor type">ExtendedDescriptor</a></td><td class="docblock-short"><p>Alias for a <a href="../../bdk/descriptor/enum.Descriptor.html" title="Descriptor"><code>Descriptor</code></a> that can contain extended keys using <a href="../../bdk/keys/enum.DescriptorPublicKey.html" title="DescriptorPublicKey"><code>DescriptorPublicKey</code></a></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><tr class="module-item"><td><a class="type" href="type.KeyMap.html" title="bdk::descriptor::KeyMap type">KeyMap</a></td><td class="docblock-short"><p>Alias type for a map of public key to secret key</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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#510-525" 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>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 class="docblock"><p>Not enough items are selected to satisfy a <a href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html#variant.Thresh" title="SatisfiableItem::Thresh"><code>SatisfiableItem::Thresh</code></a></p>
+</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 class="docblock"><p>Too many items are selected to satisfy a <a href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html#variant.Thresh" title="SatisfiableItem::Thresh"><code>SatisfiableItem::Thresh</code></a></p>
+</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 class="docblock"><p>Index out of range for an item to satisfy a <a href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html#variant.Thresh" title="SatisfiableItem::Thresh"><code>SatisfiableItem::Thresh</code></a></p>
+</div><div id="variant.AddOnLeaf" class="variant small-section-header"><a href="#variant.AddOnLeaf" class="anchor field"></a><code>AddOnLeaf</code></div><div class="docblock"><p>Can not add to an item that is <a href="../../../bdk/descriptor/policy/enum.Satisfaction.html#variant.None" title="Satisfaction::None"><code>Satisfaction::None</code></a> or <a href="../../../bdk/descriptor/policy/enum.Satisfaction.html#variant.Complete" title="Satisfaction::Complete"><code>Satisfaction::Complete</code></a></p>
+</div><div id="variant.AddOnPartialComplete" class="variant small-section-header"><a href="#variant.AddOnPartialComplete" class="anchor field"></a><code>AddOnPartialComplete</code></div><div class="docblock"><p>Can not add to an item that is <a href="../../../bdk/descriptor/policy/enum.Satisfaction.html#variant.PartialComplete" title="Satisfaction::PartialComplete"><code>Satisfaction::PartialComplete</code></a></p>
+</div><div id="variant.MixedTimelockUnits" class="variant small-section-header"><a href="#variant.MixedTimelockUnits" class="anchor field"></a><code>MixedTimelockUnits</code></div><div class="docblock"><p>Can not merge CSV or timelock values unless both are less than or both are equal or greater than 500_000_000</p>
+</div><div id="variant.IncompatibleConditions" class="variant small-section-header"><a href="#variant.IncompatibleConditions" class="anchor field"></a><code>IncompatibleConditions</code></div><div class="docblock"><p>Incompatible conditions (not currently used)</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/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#509" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#509" 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#527-531" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#528-530" 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#533" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#167" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#167" 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/descriptor/error.rs.html#85" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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/descriptor/error.rs.html#85" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#263-305" 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>>,
+ sorted: <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.bool.html">bool</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>>,
+ sorted: <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.bool.html">bool</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>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.sorted" class="variant small-section-header"><a href="#variant.Partial.field.sorted" class="anchor field"></a><code>sorted: <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.bool.html">bool</a>></code></span><div class="docblock"><p>Whether the items are sorted in lexicographic order (used by <code>sortedmulti</code>)</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="../../../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>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.sorted" class="variant small-section-header"><a href="#variant.PartialComplete.field.sorted" class="anchor field"></a><code>sorted: <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.bool.html">bool</a>></code></span><div class="docblock"><p>Whether the items are sorted in lexicographic order (used by <code>sortedmulti</code>)</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="../../../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>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="../../../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>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#307-424" 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/bdk/descriptor/policy.rs.html#309-314" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whether the <a href="../../../bdk/descriptor/policy/enum.Satisfaction.html" title="Satisfaction"><code>Satisfaction</code></a> is a leaf item</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="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#261" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#261" 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>pub 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#128-130" 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#261" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#261" 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#426-436" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#427-435" 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.118/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#261" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/descriptor/policy.rs.html#261" 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.118/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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#111-163" 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>,
+ },
+ 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>,
+ },
+ 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>,
+ },
+}</pre></div><div class="docblock"><p>An item that needs 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="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div class="docblock"><p>Signature for a raw public key</p>
+</div><div id="variant.SignatureKey" class="variant small-section-header"><a href="#variant.SignatureKey" class="anchor field"></a><code>SignatureKey(<a class="struct" href="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>)</code></div><div class="docblock"><p>Signature for an extended key fingerprint</p>
+</div><div id="variant.SHA256Preimage" class="variant small-section-header"><a href="#variant.SHA256Preimage" class="anchor field"></a><code>SHA256Preimage</code></div><div class="docblock"><p>SHA256 preimage hash</p>
+</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 class="docblock"><p>The digest value</p>
+</div></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="docblock"><p>Double SHA256 preimage hash</p>
+</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 class="docblock"><p>The digest value</p>
+</div></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="docblock"><p>RIPEMD160 preimage hash</p>
+</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 class="docblock"><p>The digest value</p>
+</div></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="docblock"><p>SHA256 then RIPEMD160 preimage hash</p>
+</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 class="docblock"><p>The digest value</p>
+</div></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="docblock"><p>Absolute timeclock timestamp</p>
+</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 class="docblock"><p>The timestamp value</p>
+</div></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="docblock"><p>Relative timelock locktime</p>
+</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 class="docblock"><p>The locktime value</p>
+</div></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="docblock"><p>Multi-signature public keys with threshold count</p>
+</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="../../../bdk/descriptor/policy/struct.PKOrF.html" title="struct bdk::descriptor::policy::PKOrF">PKOrF</a>></code></span><div class="docblock"><p>The raw public key or extended key fingerprint</p>
+</div><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 class="docblock"><p>The required threshold count</p>
+</div></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="docblock"><p>Threshold items with threshold count</p>
+</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="../../../bdk/descriptor/policy/struct.Policy.html" title="struct bdk::descriptor::policy::Policy">Policy</a>></code></span><div class="docblock"><p>The policy items</p>
+</div><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 class="docblock"><p>The required threshold count</p>
+</div></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#165-180" 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/bdk/descriptor/policy.rs.html#167-173" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whether the <a href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="SatisfiableItem"><code>SatisfiableItem</code></a> is a leaf item</p>
+</div><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/bdk/descriptor/policy.rs.html#176-179" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a unique id for the <a href="../../../bdk/descriptor/policy/enum.SatisfiableItem.html" title="SatisfiableItem"><code>SatisfiableItem</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-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#109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#109" 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>pub 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#128-130" 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#109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#109" 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#707-711" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#708-710" 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.118/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#109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/descriptor/policy.rs.html#109" 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.118/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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-1228" 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>
+<p>This is an <strong>EXPERIMENTAL</strong> feature, API and other major changes are expected.</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">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+<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_descriptor</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="kw-2">&</span><span class="ident">signers</span>, <span class="kw-2">&</span><span class="ident">secp</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 needs 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"><p>Type for a map of sets of <a href="../../../bdk/descriptor/policy/struct.Condition.html" title="Condition"><code>Condition</code></a> items keyed by each set's index</p>
+</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"><p>Type for a map of folded sets of <a href="../../../bdk/descriptor/policy/struct.Condition.html" title="Condition"><code>Condition</code></a> items keyed by a vector of the combined set's indexes</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":[["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 needs 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","Type for a map of sets of [`Condition`] items keyed by each set's index"],["FoldedConditionMap","Type for a map of folded sets of [`Condition`] items keyed by a vector of the combined set's indexes"]]});
\ 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#455-462" 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>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><div class="docblock"><p>Optional CheckSequenceVerify condition</p>
+</div><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><div class="docblock"><p>Optional timelock condition</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.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#464-506" 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/bdk/descriptor/policy.rs.html#503-505" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if there are no extra conditions to verify</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.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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#454" 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>pub 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#128-130" 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#454" 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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#454" 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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#454" 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#454" 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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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#454" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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#454" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#454" 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>pub 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#454" 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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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#454" 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>pub 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#454" 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>pub 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#454" 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>pub 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#454" 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>pub 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#454" 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.118/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#454" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/descriptor/policy.rs.html#454" 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.118/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#454" 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#454" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#77-84" 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#76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#76" 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>pub 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#128-130" 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#76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#76" 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#76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#76" 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.118/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#76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/descriptor/policy.rs.html#76" 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.118/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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#440-451" 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: <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="../../../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>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>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#535-705" 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/bdk/descriptor/policy.rs.html#632-634" 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="../../../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#638-704" 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#439" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#439" 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>pub 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#128-130" 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#439" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#439" 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#707-711" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#708-710" 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.118/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#439" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/descriptor/policy.rs.html#439" 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.118/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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#241" 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><div class="docblock"><p>Type for a map of sets of <a href="../../../bdk/descriptor/policy/struct.Condition.html" title="Condition"><code>Condition</code></a> items keyed by each set's index</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 `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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#243" 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><div class="docblock"><p>Type for a map of folded sets of <a href="../../../bdk/descriptor/policy/struct.Condition.html" title="Condition"><code>Condition</code></a> items keyed by a vector of the combined set's indexes</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
+initSidebarItems({"enum":[["Descriptor","Script descriptor"],["Legacy","Legacy ScriptContext To be used as P2SH scripts For creation of Bare scriptpubkeys, construct the Miniscript under `Bare` ScriptContext"],["Segwitv0","Segwitv0 ScriptContext"],["Terminal","All AST elements"]],"mod":[["checksum","Descriptor checksum"],["error","Descriptor errors"],["policy","Descriptor policy"],["template","Descriptor templates"]],"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","The ScriptContext for Miniscript. Additional type information associated with miniscript that is used for carrying out checks that dependent on the context under which the script is used. For example, disallowing uncompressed keys in Segwit context"],["ToPublicKey","Trait describing public key types which can be converted to bitcoin pubkeys The trait relies on Copy trait because in all practical usecases `ToPkCtx` should contain references to objects which should be cheap to `Copy`."],["ToWalletDescriptor","Trait for types which can be converted into an [`ExtendedDescriptor`] and a [`KeyMap`] usable by a wallet in a specific [`Network`]"]],"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`"],["KeyMap","Alias type for a map of public key to secret key"]]});
\ 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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.branches">branches</a><a href="#method.encode">encode</a><a href="#method.from_ast">from_ast</a><a href="#method.from_str_insane">from_str_insane</a><a href="#method.get_leaf_pk">get_leaf_pk</a><a href="#method.get_leaf_pk_pkh">get_leaf_pk_pkh</a><a href="#method.get_leaf_pkh">get_leaf_pkh</a><a href="#method.get_nth_child">get_nth_child</a><a href="#method.get_nth_pk">get_nth_pk</a><a href="#method.get_nth_pk_pkh">get_nth_pk_pkh</a><a href="#method.get_nth_pkh">get_nth_pkh</a><a href="#method.has_mixed_timelocks">has_mixed_timelocks</a><a href="#method.has_repeated_keys">has_repeated_keys</a><a href="#method.into_inner">into_inner</a><a href="#method.is_non_malleable">is_non_malleable</a><a href="#method.iter">iter</a><a href="#method.iter_pk">iter_pk</a><a href="#method.iter_pk_pkh">iter_pk_pkh</a><a href="#method.iter_pkh">iter_pkh</a><a href="#method.lift_check">lift_check</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.parse_insane">parse_insane</a><a href="#method.requires_sig">requires_sig</a><a href="#method.sanity_check">sanity_check</a><a href="#method.satisfy">satisfy</a><a href="#method.satisfy_malleable">satisfy_malleable</a><a href="#method.script_size">script_size</a><a href="#method.translate_pk">translate_pk</a><a href="#method.within_resource_limits">within_resource_limits</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>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>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="../../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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.requires_sig" class="method"><code>pub fn <a href="#method.requires_sig" class="fnname">requires_sig</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class="docblock"><p>Whether all spend paths of miniscript require a signature</p>
+</div><h4 id="method.is_non_malleable" class="method"><code>pub fn <a href="#method.is_non_malleable" class="fnname">is_non_malleable</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class="docblock"><p>Whether the miniscript is malleable</p>
+</div><h4 id="method.within_resource_limits" class="method"><code>pub fn <a href="#method.within_resource_limits" class="fnname">within_resource_limits</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class="docblock"><p>Whether the miniscript can exceed the resource limits(Opcodes, Stack limit etc)</p>
+</div><h4 id="method.has_mixed_timelocks" class="method"><code>pub fn <a href="#method.has_mixed_timelocks" class="fnname">has_mixed_timelocks</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class="docblock"><p>Whether the miniscript contains a combination of timelocks</p>
+</div><h4 id="method.has_repeated_keys" class="method"><code>pub fn <a href="#method.has_repeated_keys" class="fnname">has_repeated_keys</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class="docblock"><p>Whether the miniscript has repeated Pk or Pkh</p>
+</div><h4 id="method.sanity_check" class="method"><code>pub fn <a href="#method.sanity_check" class="fnname">sanity_check</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.unit.html">()</a>, AnalysisError></code></h4><div class="docblock"><p>Check whether the underlying Miniscript is safe under the current context
+Lifting these polices would create a semantic representation that does
+not represent the underlying semantics when miniscript is spent.
+Signing logic may not find satisfaction even if one exists.</p>
+<p>For most cases, users should be dealing with safe scripts.
+Use this function to check whether the guarantees of library hold.
+Most functions of the library like would still
+work, but results cannot be relied upon</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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="docblock"><p>Iterator-related extensions for <a href="../../bdk/descriptor/struct.Miniscript.html" title="Miniscript">Miniscript</a></p>
+</div><div class="impl-items"><h4 id="method.iter" class="method"><code>pub fn <a href="#method.iter" class="fnname">iter</a>(&self) -> Iter<'_, Pk, Ctx></code></h4><div class="docblock"><p>Creates a new [Iter] iterator that will iterate over all <a href="../../bdk/descriptor/struct.Miniscript.html" title="Miniscript">Miniscript</a> items within
+AST by traversing its branches. For the specific algorithm please see
+[Iter::next] function.</p>
+</div><h4 id="method.iter_pk" class="method"><code>pub fn <a href="#method.iter_pk" class="fnname">iter_pk</a>(&self) -> PkIter<'_, Pk, Ctx></code></h4><div class="docblock"><p>Creates a new [PkIter] iterator that will iterate over all plain public keys (and not
+key hash values) present in <a href="../../bdk/descriptor/struct.Miniscript.html" title="Miniscript">Miniscript</a> items within AST by traversing all its branches.
+For the specific algorithm please see [PkIter::next] function.</p>
+</div><h4 id="method.iter_pkh" class="method"><code>pub fn <a href="#method.iter_pkh" class="fnname">iter_pkh</a>(&self) -> PkhIter<'_, Pk, Ctx></code></h4><div class="docblock"><p>Creates a new [PkhIter] iterator that will iterate over all public keys hashes (and not
+plain public keys) present in Miniscript items within AST by traversing all its branches.
+For the specific algorithm please see [PkhIter::next] function.</p>
+</div><h4 id="method.iter_pk_pkh" class="method"><code>pub fn <a href="#method.iter_pk_pkh" class="fnname">iter_pk_pkh</a>(&self) -> PkPkhIter<'_, Pk, Ctx></code></h4><div class="docblock"><p>Creates a new [PkPkhIter] iterator that will iterate over all plain public keys and
+key hash values present in Miniscript items within AST by traversing all its branches.
+For the specific algorithm please see [PkPkhIter::next] function.</p>
+</div><h4 id="method.branches" class="method"><code>pub fn <a href="#method.branches" class="fnname">branches</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="../../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/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></code></h4><div class="docblock"><p>Enumerates all child nodes of the current AST node (<code>self</code>) and returns a <code>Vec</code> referencing
+them.</p>
+</div><h4 id="method.get_nth_child" class="method"><code>pub fn <a href="#method.get_nth_child" class="fnname">get_nth_child</a>(&self, n: <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="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx>></code></h4><div class="docblock"><p>Returns child node with given index, if any</p>
+</div><h4 id="method.get_leaf_pk" class="method"><code>pub fn <a href="#method.get_leaf_pk" class="fnname">get_leaf_pk</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></code></h4><div class="docblock"><p>Returns <code>Vec</code> with cloned version of all public keys from the current miniscript item,
+if any. Otherwise returns an empty <code>Vec</code>.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.
+To obtain a list of all public keys within AST use [fn.iter_pk()] function, for example
+<code>miniscript.iter_pubkeys().collect()</code>.</p>
+</div><h4 id="method.get_leaf_pkh" class="method"><code>pub fn <a href="#method.get_leaf_pkh" class="fnname">get_leaf_pkh</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</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="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></code></h4><div class="docblock"><p>Returns <code>Vec</code> with hashes of all public keys from the current miniscript item, if any.
+Otherwise returns an empty <code>Vec</code>.</p>
+<p>For each public key the function computes hash; for each hash of the public key the function
+returns its cloned copy.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.
+To obtain a list of all public key hashes within AST use [fn.iter_pkh()] function,
+for example <code>miniscript.iter_pubkey_hashes().collect()</code>.</p>
+</div><h4 id="method.get_leaf_pk_pkh" class="method"><code>pub fn <a href="#method.get_leaf_pk_pkh" class="fnname">get_leaf_pk_pkh</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><PkPkh<Pk>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></code></h4><div class="docblock"><p>Returns <code>Vec</code> of [PkPkh] entries, representing either public keys or public key
+hashes, depending on the data from the current miniscript item. If there is no public
+keys or hashes, the function returns an empty <code>Vec</code>.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.
+To obtain a list of all public keys or hashes within AST use [fn.iter_pk_pkh()]
+function, for example <code>miniscript.iter_pubkeys_and_hashes().collect()</code>.</p>
+</div><h4 id="method.get_nth_pk" class="method"><code>pub fn <a href="#method.get_nth_pk" class="fnname">get_nth_pk</a>(&self, n: <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><Pk></code></h4><div class="docblock"><p>Returns <code>Option::Some</code> with cloned n'th public key from the current miniscript item,
+if any. Otherwise returns <code>Option::None</code>.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.</p>
+</div><h4 id="method.get_nth_pkh" class="method"><code>pub fn <a href="#method.get_nth_pkh" class="fnname">get_nth_pkh</a>(&self, n: <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><<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></h4><div class="docblock"><p>Returns <code>Option::Some</code> with hash of n'th public key from the current miniscript item,
+if any. Otherwise returns <code>Option::None</code>.</p>
+<p>For each public key the function computes hash; for each hash of the public key the function
+returns it cloned copy.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.</p>
+</div><h4 id="method.get_nth_pk_pkh" class="method"><code>pub fn <a href="#method.get_nth_pk_pkh" class="fnname">get_nth_pk_pkh</a>(&self, n: <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><PkPkh<Pk>></code></h4><div class="docblock"><p>Returns <code>Option::Some</code> with hash of n'th public key or hash from the current miniscript item,
+if any. Otherwise returns <code>Option::None</code>.</p>
+<p>NB: The function analyzes only single miniscript item and not any of its descendants in AST.</p>
+</div></div><h3 id="impl-2" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-2" 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="../../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-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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-3" 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="../../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>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 class="docblock"><p>Get a reference to the inner <code>AstElem</code> representing the root of miniscript</p>
+</div></div><h3 id="impl-4" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>, </span></code><a href="#impl-4" class="anchor"></a></h3><div class="impl-items"><h4 id="method.parse_insane" class="method"><code>pub fn <a href="#method.parse_insane" class="fnname">parse_insane</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="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 an insane(scripts don't clear sanity checks)
+script into a Miniscript representation.
+Use this to parse scripts with repeated pubkeys, timelock mixing, malleable
+scripts without sig or scripts that can exceed resource limits.
+Some of the analysis guarantees of miniscript are lost when dealing with
+insane scripts. In general, in a multi-party setting users should only
+accept sane scripts.</p>
+</div><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="../../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 Miniscript representation.
+This function will fail parsing for scripts that do not clear
+the [fn.analyzable.sanity_check] checks. Use [fn.parse_insane] to
+parse such scripts.</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-5" 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><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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></div><h3 id="impl-6" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-6" class="anchor"></a></h3><div class="impl-items"><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="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 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 return None on malformed <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) -> <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 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>
+</div></div><h3 id="impl-7" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-7" 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="../../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><h4 id="method.from_str_insane" class="method"><code>pub fn <a href="#method.from_str_insane" class="fnname">from_str_insane</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> <span class="where fmt-newline">where<br> <Pk as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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></h4><div class="docblock"><p>Attempt to parse an insane(scripts don't clear sanity checks)
+from string into a Miniscript representation.
+Use this to parse scripts with repeated pubkeys, timelock mixing, malleable
+scripts without sig or scripts that can exceed resource limits.
+Some of the analysis guarantees of miniscript are lost when dealing with
+insane scripts. In general, in a multi-party setting users should only
+accept sane scripts.</p>
+</div></div><h3 id="impl-8" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-8" 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><ToPkCtx, S>(<br> &self, <br> satisfier: S, <br> to_pk_ctx: ToPkCtx<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="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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, Error> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> S: Satisfier<ToPkCtx, Pk>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Attempt to produce non-malleable satisfying witness for the
+witness script represented by the parse tree</p>
+</div><h4 id="method.satisfy_malleable" class="method"><code>pub fn <a href="#method.satisfy_malleable" class="fnname">satisfy_malleable</a><ToPkCtx, S>(<br> &self, <br> satisfier: S, <br> to_pk_ctx: ToPkCtx<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="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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, Error> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> S: Satisfier<ToPkCtx, Pk>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Attempt to produce a malleable satisfying witness for the
+witness script represented by the parse tree</p>
+</div></div><h3 id="impl-9" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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-9" class="anchor"></a></h3><div class="impl-items"><h4 id="method.lift_check" class="method"><code>pub fn <a href="#method.lift_check" class="fnname">lift_check</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.unit.html">()</a>, LiftError></code></h4><div class="docblock"><p>Lifting corresponds conversion of miniscript into Policy
+[policy.semantic.Policy] for human readable or machine analysis.
+However, naively lifting miniscripts can result in incorrect
+interpretations that don't correspond underlying semantics when
+we try to spend them on bitcoin network.
+This can occur if the miniscript contains a</p>
+<ol>
+<li>Timelock combination</li>
+<li>Contains a spend that exceeds resource limits</li>
+</ol>
+</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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>pub 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#128-130" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/keys/trait.ScriptContext.html" title="trait bdk::keys::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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, Ctx></code><a href="#impl-ExtractPolicy" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/policy.rs.html#752-844" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.extract_policy" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ExtractPolicy.html#tymethod.extract_policy" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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#753-843" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Extract the spending <a href="../../bdk/descriptor/policy/index.html" title="policy"><code>policy</code></a></p>
+</div></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/traits/trait.FromStr.html" title="trait core::str::traits::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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/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"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/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"><p>Parse a Miniscript from string and perform sanity checks
+See [fn.from_str_insane] to parse scripts from string that
+do not clear the [fn.analyzable.sanity_check] checks.</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::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>pub 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub fn <a href="#method.lift" class="fnname">lift</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Policy<Pk>, Error></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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#209-211" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#959-961" 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>pub 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#978-980" 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>pub 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#996-998" 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>pub 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#1015-1017" 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `template` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, template"><title>bdk::descriptor::template - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module template</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">descriptor</a></p><script>window.sidebarCurrent = {name: "template", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#25-727" 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="">template</a></span></h1><div class="docblock"><p>Descriptor templates</p>
+<p>This module contains the definition of various common script templates that are ready to be
+used. See the documentation of each template for an example.</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.BIP44.html" title="bdk::descriptor::template::BIP44 struct">BIP44</a></td><td class="docblock-short"><p>BIP44 template. Expands to <code>pkh(key/44'/0'/0'/{0,1}/*)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.BIP44Public.html" title="bdk::descriptor::template::BIP44Public struct">BIP44Public</a></td><td class="docblock-short"><p>BIP44 public template. Expands to <code>pkh(key/{0,1}/*)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.BIP49.html" title="bdk::descriptor::template::BIP49 struct">BIP49</a></td><td class="docblock-short"><p>BIP49 template. Expands to <code>sh(wpkh(key/49'/0'/0'/{0,1}/*))</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.BIP49Public.html" title="bdk::descriptor::template::BIP49Public struct">BIP49Public</a></td><td class="docblock-short"><p>BIP49 public template. Expands to <code>sh(wpkh(key/{0,1}/*))</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.BIP84.html" title="bdk::descriptor::template::BIP84 struct">BIP84</a></td><td class="docblock-short"><p>BIP84 template. Expands to <code>wpkh(key/84'/0'/0'/{0,1}/*)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.BIP84Public.html" title="bdk::descriptor::template::BIP84Public struct">BIP84Public</a></td><td class="docblock-short"><p>BIP84 public template. Expands to <code>wpkh(key/{0,1}/*)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.P2PKH.html" title="bdk::descriptor::template::P2PKH struct">P2PKH</a></td><td class="docblock-short"><p>P2PKH template. Expands to a descriptor <code>pkh(key)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.P2WPKH.html" title="bdk::descriptor::template::P2WPKH struct">P2WPKH</a></td><td class="docblock-short"><p>P2WPKH template. Expands to a descriptor <code>wpkh(key)</code></p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.P2WPKH_P2SH.html" title="bdk::descriptor::template::P2WPKH_P2SH struct">P2WPKH_P2SH</a></td><td class="docblock-short"><p>P2WPKH-P2SH template. Expands to a descriptor <code>sh(wpkh(key))</code></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.DescriptorTemplate.html" title="bdk::descriptor::template::DescriptorTemplate trait">DescriptorTemplate</a></td><td class="docblock-short"><p>Trait for descriptor templates that can be built into a full descriptor</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.DescriptorTemplateOut.html" title="bdk::descriptor::template::DescriptorTemplateOut type">DescriptorTemplateOut</a></td><td class="docblock-short"><p>Type alias for the return type of <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="DescriptorTemplate"><code>DescriptorTemplate</code></a>, <a href="../../../bdk/macro.descriptor.html"><code>descriptor!</code></a> and others</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":[["BIP44","BIP44 template. Expands to `pkh(key/44'/0'/0'/{0,1}/*)`"],["BIP44Public","BIP44 public template. Expands to `pkh(key/{0,1}/*)`"],["BIP49","BIP49 template. Expands to `sh(wpkh(key/49'/0'/0'/{0,1}/*))`"],["BIP49Public","BIP49 public template. Expands to `sh(wpkh(key/{0,1}/*))`"],["BIP84","BIP84 template. Expands to `wpkh(key/84'/0'/0'/{0,1}/*)`"],["BIP84Public","BIP84 public template. Expands to `wpkh(key/{0,1}/*)`"],["P2PKH","P2PKH template. Expands to a descriptor `pkh(key)`"],["P2WPKH","P2WPKH template. Expands to a descriptor `wpkh(key)`"],["P2WPKH_P2SH","P2WPKH-P2SH template. Expands to a descriptor `sh(wpkh(key))`"]],"trait":[["DescriptorTemplate","Trait for descriptor templates that can be built into a full descriptor"]],"type":[["DescriptorTemplateOut","Type alias for the return type of [`DescriptorTemplate`], `descriptor!` and others"]]});
\ 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 `BIP44` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP44"><title>bdk::descriptor::template::BIP44 - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP44</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP44", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#205" 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">template</a>::<wbr><a class="struct" href="">BIP44</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP44<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>>(pub K, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP44 template. Expands to <code>pkh(key/44'/0'/0'/{0,1}/*)</code></p>
+<p>Since there are hardened derivation steps, this template requires a private derivable key (generally a <code>xprv</code>/<code>tprv</code>).</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP44Public.html" title="BIP44Public"><code>BIP44Public</code></a> for a template that can work with a <code>xpub</code>/<code>tpub</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP44</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m"</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="ident">BIP44</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP44</span>(<span class="ident">key</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"miNG7dJTzJqNbFS19svRdTCisC65dsubtR"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#208-210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `BIP44Public` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP44Public"><title>bdk::descriptor::template::BIP44Public - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP44Public</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP44Public", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#244" 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">template</a>::<wbr><a class="struct" href="">BIP44Public</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP44Public<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>>(pub K, pub Fingerprint, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP44 public template. Expands to <code>pkh(key/{0,1}/*)</code></p>
+<p>This assumes that the key used has already been derived with <code>m/44'/0'/0'</code>.</p>
+<p>This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP44.html" title="BIP44"><code>BIP44</code></a> for a template that does the full derivation, but requires private data
+for the key.</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP44Public</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</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="ident">BIP44Public</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP44Public</span>(<span class="ident">key</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"miNG7dJTzJqNbFS19svRdTCisC65dsubtR"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#246-250" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#247-249" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `BIP49` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP49"><title>bdk::descriptor::template::BIP49 - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP49</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP49", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#279" 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">template</a>::<wbr><a class="struct" href="">BIP49</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP49<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP49 template. Expands to <code>sh(wpkh(key/49'/0'/0'/{0,1}/*))</code></p>
+<p>Since there are hardened derivation steps, this template requires a private derivable key (generally a <code>xprv</code>/<code>tprv</code>).</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP49Public.html" title="BIP49Public"><code>BIP49Public</code></a> for a template that can work with a <code>xpub</code>/<code>tpub</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP49</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m"</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="ident">BIP49</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP49</span>(<span class="ident">key</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"sh(wpkh([c55b303f/49\'/0\'/0\']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#281-285" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#282-284" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `BIP49Public` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP49Public"><title>bdk::descriptor::template::BIP49Public - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP49Public</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP49Public", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#318" 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">template</a>::<wbr><a class="struct" href="">BIP49Public</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP49Public<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K, pub Fingerprint, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP49 public template. Expands to <code>sh(wpkh(key/{0,1}/*))</code></p>
+<p>This assumes that the key used has already been derived with <code>m/49'/0'/0'</code>.</p>
+<p>This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP49.html" title="BIP49"><code>BIP49</code></a> for a template that does the full derivation, but requires private data
+for the key.</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP49Public</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</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="ident">BIP49Public</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP49Public</span>(<span class="ident">key</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"sh(wpkh([c55b303f/49\'/0\'/0\']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#320-324" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#321-323" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `BIP84` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP84"><title>bdk::descriptor::template::BIP84 - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP84</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP84", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#353" 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">template</a>::<wbr><a class="struct" href="">BIP84</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP84<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP84 template. Expands to <code>wpkh(key/84'/0'/0'/{0,1}/*)</code></p>
+<p>Since there are hardened derivation steps, this template requires a private derivable key (generally a <code>xprv</code>/<code>tprv</code>).</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP84Public.html" title="BIP84Public"><code>BIP84Public</code></a> for a template that can work with a <code>xpub</code>/<code>tpub</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP84</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m"</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="ident">BIP84</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP84</span>(<span class="ident">key</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#355-359" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#356-358" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `BIP84Public` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BIP84Public"><title>bdk::descriptor::template::BIP84Public - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BIP84Public</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "BIP84Public", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#392" 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">template</a>::<wbr><a class="struct" href="">BIP84Public</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BIP84Public<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K, pub Fingerprint, pub <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>);</pre></div><div class="docblock"><p>BIP84 public template. Expands to <code>wpkh(key/{0,1}/*)</code></p>
+<p>This assumes that the key used has already been derived with <code>m/84'/0'/0'</code>.</p>
+<p>This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</p>
+<p>See <a href="../../../bdk/descriptor/template/struct.BIP84.html" title="BIP84"><code>BIP84</code></a> for a template that does the full derivation, but requires private data
+for the key.</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">BIP84Public</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</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="ident">BIP84Public</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">BIP84Public</span>(<span class="ident">key</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(), <span class="string">"tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7"</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet</span>.<span class="ident">public_descriptor</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>.<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)"</span>);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#394-398" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#395-397" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `P2PKH` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, P2PKH"><title>bdk::descriptor::template::P2PKH - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct P2PKH</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "P2PKH", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#103" 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">template</a>::<wbr><a class="struct" href="">P2PKH</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct P2PKH<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>>(pub K);</pre></div><div class="docblock"><p>P2PKH template. Expands to a descriptor <code>pkh(key)</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">P2PKH</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</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="ident">P2PKH</span>(<span class="ident">key</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="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(),
+ <span class="string">"mwJ8hxFYW19JLuc65RCTaP4v1rzVU8cVMT"</span>
+);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#105-109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#106-108" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `P2WPKH` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, P2WPKH"><title>bdk::descriptor::template::P2WPKH - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct P2WPKH</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "P2WPKH", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#170" 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">template</a>::<wbr><a class="struct" href="">P2WPKH</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct P2WPKH<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K);</pre></div><div class="docblock"><p>P2WPKH template. Expands to a descriptor <code>wpkh(key)</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">P2WPKH</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</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="ident">P2WPKH</span>(<span class="ident">key</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="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(),
+ <span class="string">"tb1q4525hmgw265tl3drrl8jjta7ayffu6jf68ltjd"</span>
+);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#172-176" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#173-175" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `P2WPKH_P2SH` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, P2WPKH_P2SH"><title>bdk::descriptor::template::P2WPKH_P2SH - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct P2WPKH_P2SH</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-DescriptorTemplate">DescriptorTemplate</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToWalletDescriptor">ToWalletDescriptor</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">template</a></p><script>window.sidebarCurrent = {name: "P2WPKH_P2SH", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#137" 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">template</a>::<wbr><a class="struct" href="">P2WPKH_P2SH</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct P2WPKH_P2SH<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>>(pub K);</pre></div><div class="docblock"><p>P2WPKH-P2SH template. Expands to a descriptor <code>sh(wpkh(key))</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">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::<span class="ident">P2WPKH_P2SH</span>;
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</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="ident">P2WPKH_P2SH</span>(<span class="ident">key</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="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>.<span class="ident">to_string</span>(),
+ <span class="string">"2NB4ox5VDRw1ecUv6SnT3VQHPXveYztRqk5"</span>
+);</pre></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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a> for <a class="struct" href="../../../bdk/descriptor/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#139-143" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#140-142" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Build the complete descriptor</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<K> <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/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K> <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/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K> <span class="where fmt-newline">where<br> K: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></p>
+</div></div><h3 id="impl-ToWalletDescriptor" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>, </span></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> Self, <br> Network<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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#70-75" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `DescriptorTemplate` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorTemplate"><title>bdk::descriptor::template::DescriptorTemplate - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Trait DescriptorTemplate</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.build">build</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>::<wbr><a href="index.html">template</a></p><script>window.sidebarCurrent = {name: "DescriptorTemplate", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#62-65" 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 href="index.html">template</a>::<wbr><a class="trait" href="">DescriptorTemplate</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait DescriptorTemplate {
+ pub fn <a href="#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>>;
+}</pre></div><div class="docblock"><p>Trait for descriptor templates that can be built into a full descriptor</p>
+<p>Since <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="ToWalletDescriptor"><code>ToWalletDescriptor</code></a> is implemented for any <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="DescriptorTemplate"><code>DescriptorTemplate</code></a>, they can also be
+passed directly to the <a href="../../../bdk/wallet/struct.Wallet.html"><code>Wallet</code></a> constructor.</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">use</span> <span class="ident">bdk</span>::<span class="ident">keys</span>::{<span class="ident">KeyError</span>, <span class="ident">ToDescriptorKey</span>};
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">miniscript</span>::<span class="ident">Legacy</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">template</span>::{<span class="ident">DescriptorTemplate</span>, <span class="ident">DescriptorTemplateOut</span>};
+
+<span class="kw">struct</span> <span class="ident">MyP2PKH</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span>(<span class="ident">K</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">MyP2PKH</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="self">self</span>.<span class="number">0</span>))<span class="question-mark">?</span>)
+ }
+}</pre></div>
+</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.build" class="method"><code>pub fn <a href="#tymethod.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#64" title="goto source code">[src]</a></h3><div class="docblock"><p>Build the complete descriptor</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-DescriptorTemplate" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP44.html" title="struct bdk::descriptor::template::BIP44">BIP44</a><K></code><a href="#impl-DescriptorTemplate" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build" class="method hidden"><code>pub fn <a href="#method.build" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#208-210" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-1" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP44Public.html" title="struct bdk::descriptor::template::BIP44Public">BIP44Public</a><K></code><a href="#impl-DescriptorTemplate-1" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#246-250" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-1" class="method hidden"><code>pub fn <a href="#method.build-1" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#247-249" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-2" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP49.html" title="struct bdk::descriptor::template::BIP49">BIP49</a><K></code><a href="#impl-DescriptorTemplate-2" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#281-285" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-2" class="method hidden"><code>pub fn <a href="#method.build-2" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#282-284" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-3" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP49Public.html" title="struct bdk::descriptor::template::BIP49Public">BIP49Public</a><K></code><a href="#impl-DescriptorTemplate-3" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#320-324" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-3" class="method hidden"><code>pub fn <a href="#method.build-3" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#321-323" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-4" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP84.html" title="struct bdk::descriptor::template::BIP84">BIP84</a><K></code><a href="#impl-DescriptorTemplate-4" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#355-359" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-4" class="method hidden"><code>pub fn <a href="#method.build-4" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#356-358" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-5" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.BIP84Public.html" title="struct bdk::descriptor::template::BIP84Public">BIP84Public</a><K></code><a href="#impl-DescriptorTemplate-5" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#394-398" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-5" class="method hidden"><code>pub fn <a href="#method.build-5" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#395-397" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-6" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Legacy.html" title="enum bdk::descriptor::Legacy">Legacy</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.P2PKH.html" title="struct bdk::descriptor::template::P2PKH">P2PKH</a><K></code><a href="#impl-DescriptorTemplate-6" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#105-109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-6" class="method hidden"><code>pub fn <a href="#method.build-6" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#106-108" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-7" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.P2WPKH.html" title="struct bdk::descriptor::template::P2WPKH">P2WPKH</a><K></code><a href="#impl-DescriptorTemplate-7" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#172-176" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-7" class="method hidden"><code>pub fn <a href="#method.build-7" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#173-175" title="goto source code">[src]</a></h4></div><h3 id="impl-DescriptorTemplate-8" class="impl"><code class="in-band">impl<K: <a class="trait" href="../../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><<a class="enum" href="../../../bdk/descriptor/enum.Segwitv0.html" title="enum bdk::descriptor::Segwitv0">Segwitv0</a>>> DescriptorTemplate for <a class="struct" href="../../../bdk/descriptor/template/struct.P2WPKH_P2SH.html" title="struct bdk::descriptor::template::P2WPKH_P2SH">P2WPKH_P2SH</a><K></code><a href="#impl-DescriptorTemplate-8" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#139-143" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.build-8" class="method hidden"><code>pub fn <a href="#method.build-8" class="fnname">build</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="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/template.rs.html#140-142" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../../implementors/bdk/descriptor/template/trait.DescriptorTemplate.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 `DescriptorTemplateOut` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorTemplateOut"><title>bdk::descriptor::template::DescriptorTemplateOut - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition DescriptorTemplateOut</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-ToWalletDescriptor">ToWalletDescriptor</a></div></div><p class="location"><a href="../../index.html">bdk</a>::<wbr><a href="../index.html">descriptor</a>::<wbr><a href="index.html">template</a></p><script>window.sidebarCurrent = {name: "DescriptorTemplateOut", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/template.rs.html#40" 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">template</a>::<wbr><a class="type" href="">DescriptorTemplateOut</a></span></h1><pre class="rust typedef">type DescriptorTemplateOut = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a>, <a class="type" href="../../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>;</pre><div class="docblock"><p>Type alias for the return type of <a href="../../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="DescriptorTemplate"><code>DescriptorTemplate</code></a>, <a href="../../../bdk/macro.descriptor.html"><code>descriptor!</code></a> and others</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-ToWalletDescriptor" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for <a class="type" href="../../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../../src/bdk/descriptor/mod.rs.html#153-188" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/descriptor/mod.rs.html#154-187" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</p>
+</div></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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#191-198" 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 {
+ pub fn <a href="#tymethod.extract_policy" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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 <a href="../../bdk/descriptor/enum.Descriptor.html" title="Descriptor"><code>Descriptor</code></a>s to add a method to extract the spending <a href="../../bdk/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>pub fn <a href="#tymethod.extract_policy" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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/mod.rs.html#193-197" title="goto source code">[src]</a></h3><div class="docblock"><p>Extract the spending <a href="../../bdk/descriptor/policy/index.html" title="policy"><code>policy</code></a></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-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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>></code><a href="#impl-ExtractPolicy" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/policy.rs.html#846-884" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.extract_policy" class="method hidden"><code>pub fn <a href="#method.extract_policy" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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#847-883" 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/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> ExtractPolicy for <a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, Ctx></code><a href="#impl-ExtractPolicy-1" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/policy.rs.html#752-844" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.extract_policy-1" class="method hidden"><code>pub fn <a href="#method.extract_policy-1" class="fnname">extract_policy</a>(<br> &self, <br> signers: &<a class="struct" href="../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a>, <br> secp: &Secp256k1<All><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#753-843" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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-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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/traits/trait.FromStr.html" title="trait core::str::traits::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/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>;
+ pub 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>;
+
+ pub 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/traits/trait.FromStr.html" title="trait core::str::traits::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>pub 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>pub 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-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-1" 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" class="method hidden"><code>pub 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-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-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>pub 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-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>pub 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>type <a href="#associatedtype.Hash" class="type">Hash</a> = Hash</code></h4><h4 id="method.to_pubkeyhash-2" class="method hidden"><code>pub 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><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-MiniscriptKey" class="impl"><code class="in-band">impl MiniscriptKey for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-MiniscriptKey" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Hash-4" class="type"><code>type <a href="#associatedtype.Hash-4" class="type">Hash</a> = <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code></h4><h4 id="method.to_pubkeyhash-3" class="method hidden"><code>pub fn <a href="#method.to_pubkeyhash-3" class="fnname">to_pubkeyhash</a>(&self) -> <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code></h4></div></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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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_terminal_non_malleable">check_terminal_non_malleable</a><a href="#tymethod.max_satisfaction_size">max_satisfaction_size</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.check_global_consensus_validity">check_global_consensus_validity</a><a href="#method.check_global_policy_validity">check_global_policy_validity</a><a href="#method.check_global_validity">check_global_validity</a><a href="#method.check_local_consensus_validity">check_local_consensus_validity</a><a href="#method.check_local_policy_validity">check_local_policy_validity</a><a href="#method.check_local_validity">check_local_validity</a><a href="#method.check_witness">check_witness</a><a href="#method.other_top_level_checks">other_top_level_checks</a><a href="#method.top_level_checks">top_level_checks</a><a href="#method.top_level_type_check">top_level_type_check</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ScriptContext-for-Bare">Bare</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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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> {
+ pub fn <a href="#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx><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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
+
+ pub fn <a href="#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> _witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>,
+ { ... }
+}</pre></div><div class="docblock"><p>The ScriptContext for Miniscript. Additional type information associated with
+miniscript that is used for carrying out checks that dependent on the
+context under which the script is used.
+For example, disallowing uncompressed keys in Segwit context</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_terminal_non_malleable" class="method"><code>pub fn <a href="#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size" class="method"><code>pub fn <a href="#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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, the size of a satifaction witness may slightly differ.</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.check_witness" class="method"><code>pub fn <a href="#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> _witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the given satisfaction is valid under the ScriptContext
+For example, segwit satisfactions may fail if the witness len is more
+3600 or number of stack elements are more than 100.</p>
+</div><h3 id="method.check_global_consensus_validity" class="method"><code>pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 under the current consensus rules.
+Or some of the script resource limits may have been exceeded.
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+uncompressed public keys are non-standard and thus invalid.
+In LegacyP2SH context, scripts above 520 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments.</p>
+</div><h3 id="method.check_global_policy_validity" class="method"><code>pub fn <a href="#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 script resource limits
+may have been exceeded under the current bitcoin core policy rules
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them. (unless explicitly disabled by non-standard flag)
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+scripts over 3600 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments.</p>
+</div><h3 id="method.check_local_consensus_validity" class="method"><code>pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Consensus rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path(Legacy/Segwitv0) may require more than 201 opcodes.</p>
+</div><h3 id="method.check_local_policy_validity" class="method"><code>pub fn <a href="#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Policy rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path in Legacy context scriptSig more
+than 1650 bytes</p>
+</div><h3 id="method.check_global_validity" class="method"><code>pub fn <a href="#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules that are not based
+satisfaction</p>
+</div><h3 id="method.check_local_validity" class="method"><code>pub fn <a href="#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules including the
+ones for satisfaction</p>
+</div><h3 id="method.top_level_type_check" class="method"><code>pub fn <a href="#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the top-level is type B</p>
+</div><h3 id="method.other_top_level_checks" class="method"><code>pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Other top level checks that are context specific</p>
+</div><h3 id="method.top_level_checks" class="method"><code>pub fn <a href="#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(ms: &<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/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> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check top level consensus rules.</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-ScriptContext-for-Bare" class="impl"><code class="in-band">impl <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a> for Bare</code><a href="#impl-ScriptContext-for-Bare" class="anchor"></a></h3><div class="impl-items"><h4 id="method.check_terminal_non_malleable" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-1" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-1" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.other_top_level_checks-1" class="method hidden"><code>pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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><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_terminal_non_malleable-1" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable-1" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_witness-1" class="method hidden"><code>pub fn <a href="#method.check_witness-1" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-2" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity-2" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-2" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity-2" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_policy_validity-1" class="method hidden"><code>pub fn <a href="#method.check_local_policy_validity-1" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size-1" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size-1" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_terminal_non_malleable-2" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable-2" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_witness-2" class="method hidden"><code>pub fn <a href="#method.check_witness-2" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-3" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity-3" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-3" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity-3" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_policy_validity-1" class="method hidden"><code>pub fn <a href="#method.check_global_policy_validity-1" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_policy_validity-2" class="method hidden"><code>pub fn <a href="#method.check_local_policy_validity-2" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size-2" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size-2" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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%3CNullCtx%3E-for-DummyKey">DummyKey</a><a href="#impl-ToPublicKey%3CNullCtx%3E-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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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<ToPkCtx>: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a> <span class="where fmt-newline">where<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span>{
+ pub fn <a href="#tymethod.to_public_key" class="fnname">to_public_key</a>(&self, to_pk_ctx: ToPkCtx) -> PublicKey;
+<div class="item-spacer"></div> pub 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>, to_pk_ctx: ToPkCtx) -> Hash;
+
+ pub fn <a href="#method.serialized_len" class="fnname">serialized_len</a>(&self, to_pk_ctx: ToPkCtx) -> <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
+The trait relies on Copy trait because in all practical usecases <code>ToPkCtx</code>
+should contain references to objects which should be cheap to <code>Copy</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.to_public_key" class="method"><code>pub fn <a href="#tymethod.to_public_key" class="fnname">to_public_key</a>(&self, to_pk_ctx: ToPkCtx) -> PublicKey</code></h3><div class="docblock"><p>Converts an object to a public key
+C represents additional context information that maybe
+required for deriving a bitcoin::PublicKey from MiniscriptKey
+You may require secp context for crypto operations
+or additional information for substituting the wildcard in
+extended pubkeys</p>
+</div><h3 id="tymethod.hash_to_hash160" class="method"><code>pub 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>, to_pk_ctx: ToPkCtx) -> 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>pub fn <a href="#method.serialized_len" class="fnname">serialized_len</a>(&self, to_pk_ctx: ToPkCtx) -> <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%3CNullCtx%3E-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><NullCtx> for DummyKey</code><a href="#impl-ToPublicKey%3CNullCtx%3E-for-DummyKey" class="anchor"></a></h3><div class="impl-items"><h4 id="method.to_public_key" class="method hidden"><code>pub fn <a href="#method.to_public_key" class="fnname">to_public_key</a>(&self, _ctx: NullCtx) -> PublicKey</code></h4><h4 id="method.hash_to_hash160" class="method hidden"><code>pub fn <a href="#method.hash_to_hash160" class="fnname">hash_to_hash160</a>(&DummyKeyHash, _ctx: NullCtx) -> Hash</code></h4></div><h3 id="impl-ToPublicKey%3CNullCtx%3E-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><NullCtx> for PublicKey</code><a href="#impl-ToPublicKey%3CNullCtx%3E-for-PublicKey" class="anchor"></a></h3><div class="impl-items"><h4 id="method.to_public_key-1" class="method hidden"><code>pub fn <a href="#method.to_public_key" class="fnname">to_public_key</a>(&self, _ctx: NullCtx) -> PublicKey</code></h4><h4 id="method.hash_to_hash160-1" class="method hidden"><code>pub fn <a href="#method.hash_to_hash160" class="fnname">hash_to_hash160</a>(hash: &Hash, _ctx: NullCtx) -> 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"><h3 id="impl-ToPublicKey%3CDescriptorPublicKeyCtx%3C%27secp%2C%20C%3E%3E" class="impl"><code class="in-band">impl<'secp, C> ToPublicKey<DescriptorPublicKeyCtx<'secp, C>> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a> <span class="where fmt-newline">where<br> C: Verification, </span></code><a href="#impl-ToPublicKey%3CDescriptorPublicKeyCtx%3C%27secp%2C%20C%3E%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.to_public_key-2" class="method hidden"><code>pub fn <a href="#method.to_public_key-2" class="fnname">to_public_key</a>(<br> &self, <br> to_pk_ctx: DescriptorPublicKeyCtx<'secp, C><br>) -> PublicKey</code></h4><h4 id="method.hash_to_hash160-2" class="method hidden"><code>pub fn <a href="#method.hash_to_hash160-2" class="fnname">hash_to_hash160</a>(<br> hash: &<<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>, <br> to_pk_ctx: DescriptorPublicKeyCtx<'secp, C><br>) -> Hash</code></h4></div></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 `ToWalletDescriptor` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ToWalletDescriptor"><title>bdk::descriptor::ToWalletDescriptor - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait ToWalletDescriptor</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.to_wallet_descriptor">to_wallet_descriptor</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ToWalletDescriptor-for-%26%27_%20String">&'_ String</a><a href="#impl-ToWalletDescriptor-for-%26%27_%20str">&'_ str</a><a href="#impl-ToWalletDescriptor-for-(ExtendedDescriptor%2C%20KeyMap)">(ExtendedDescriptor, KeyMap)</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: "ToWalletDescriptor", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#69-75" 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="">ToWalletDescriptor</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait ToWalletDescriptor {
+ pub fn <a href="#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>>;
+}</pre></div><div class="docblock"><p>Trait for types which can be converted into an <a href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="ExtendedDescriptor"><code>ExtendedDescriptor</code></a> and a <a href="../../bdk/descriptor/type.KeyMap.html" title="KeyMap"><code>KeyMap</code></a> usable by a wallet in a specific [<code>Network</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.to_wallet_descriptor" class="method"><code>pub fn <a href="#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#71-74" title="goto source code">[src]</a></h3><div class="docblock"><p>Convert to wallet descriptor</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-ToWalletDescriptor-for-%26%27_%20str" class="impl"><code class="in-band">impl<'_> <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for &'_ <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><a href="#impl-ToWalletDescriptor-for-%26%27_%20str" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#77-99" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#78-98" title="goto source code">[src]</a></h4></div><h3 id="impl-ToWalletDescriptor-for-%26%27_%20String" class="impl"><code class="in-band">impl<'_> <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</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-ToWalletDescriptor-for-%26%27_%20String" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#101-108" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor-1" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#102-107" title="goto source code">[src]</a></h4></div><h3 id="impl-ToWalletDescriptor-for-(ExtendedDescriptor%2C%20KeyMap)" class="impl"><code class="in-band">impl <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a href="#impl-ToWalletDescriptor-for-(ExtendedDescriptor%2C%20KeyMap)" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#119-151" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor-2" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#120-150" 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-ToWalletDescriptor" class="impl"><code class="in-band">impl ToWalletDescriptor for <a class="type" href="../../bdk/descriptor/template/type.DescriptorTemplateOut.html" title="type bdk::descriptor::template::DescriptorTemplateOut">DescriptorTemplateOut</a></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#153-188" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor-3" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor-3" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#154-187" title="goto source code">[src]</a></h4></div><h3 id="impl-ToWalletDescriptor-1" class="impl"><code class="in-band">impl ToWalletDescriptor for <a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a></code><a href="#impl-ToWalletDescriptor-1" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#110-117" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor-4" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor-4" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#111-116" title="goto source code">[src]</a></h4></div><h3 id="impl-ToWalletDescriptor-2" class="impl"><code class="in-band">impl<T: <a class="trait" href="../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="trait bdk::descriptor::template::DescriptorTemplate">DescriptorTemplate</a>> ToWalletDescriptor for T</code><a href="#impl-ToWalletDescriptor-2" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/template.rs.html#69-76" title="goto source code">[src]</a></h3><div class="docblock"><p>Turns a <a href="../../bdk/descriptor/template/trait.DescriptorTemplate.html" title="DescriptorTemplate"><code>DescriptorTemplate</code></a> into a valid wallet descriptor by calling its
+<a href="../../bdk/descriptor/template/trait.DescriptorTemplate.html#tymethod.build"><code>build</code></a> method</p>
+</div><div class="impl-items"><h4 id="method.to_wallet_descriptor-5" class="method hidden"><code>pub fn <a href="#method.to_wallet_descriptor-5" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/template.rs.html#70-75" 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.ToWalletDescriptor.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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition ExtendedDescriptor</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-ToWalletDescriptor">ToWalletDescriptor</a></div></div><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#59" 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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>>;</pre><div class="docblock"><p>Alias for a <a href="../../bdk/descriptor/enum.Descriptor.html" title="Descriptor"><code>Descriptor</code></a> that can contain extended keys using <a href="../../bdk/keys/enum.DescriptorPublicKey.html" title="DescriptorPublicKey"><code>DescriptorPublicKey</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-ToWalletDescriptor" class="impl"><code class="in-band">impl <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a> for <a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a></code><a href="#impl-ToWalletDescriptor" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#110-117" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_wallet_descriptor" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ToWalletDescriptor.html#tymethod.to_wallet_descriptor" class="fnname">to_wallet_descriptor</a>(<br> self, <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><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="type" href="../../bdk/descriptor/type.ExtendedDescriptor.html" title="type bdk::descriptor::ExtendedDescriptor">ExtendedDescriptor</a>, <a class="type" href="../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/descriptor/mod.rs.html#111-116" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert to wallet descriptor</p>
+</div></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 `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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#66" 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, KeySource>;</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 `KeyMap` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, KeyMap"><title>bdk::descriptor::KeyMap - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition KeyMap</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: "KeyMap", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">Type Definition <a href="../index.html">bdk</a>::<wbr><a href="index.html">descriptor</a>::<wbr><a class="type" href="">KeyMap</a></span></h1><pre class="rust typedef">type KeyMap = <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><<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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>>;</pre><div class="docblock"><p>Alias type for a map of public key to secret key</p>
+<p>This map is returned whenever a descriptor that contains secrets is parsed using
+<a href="../../bdk/descriptor/enum.Descriptor.html#method.parse_descriptor" title="Descriptor::parse_descriptor"><code>Descriptor::parse_descriptor</code></a>, since the descriptor will always only contain
+public keys. This map allows looking up the corresponding secret key given a
+public key from the 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 `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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><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.BnBNoExactMatch">BnBNoExactMatch</a><a href="#variant.BnBTotalTriesExceeded">BnBTotalTriesExceeded</a><a href="#variant.ChecksumMismatch">ChecksumMismatch</a><a href="#variant.CompactFilters">CompactFilters</a><a href="#variant.Descriptor">Descriptor</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.FeeTooLow">FeeTooLow</a><a href="#variant.Generic">Generic</a><a href="#variant.Hex">Hex</a><a href="#variant.InsufficientFunds">InsufficientFunds</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.Key">Key</a><a href="#variant.Miniscript">Miniscript</a><a href="#variant.MissingKeyOrigin">MissingKeyOrigin</a><a href="#variant.NoRecipients">NoRecipients</a><a href="#variant.NoUtxosSelected">NoUtxosSelected</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.Signer">Signer</a><a href="#variant.SingleRecipientMultipleOutputs">SingleRecipientMultipleOutputs</a><a href="#variant.SingleRecipientNoInputs">SingleRecipientNoInputs</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.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%3CKeyError%3E">From<KeyError></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#32-142" 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 {
+ 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,
+ SingleRecipientMultipleOutputs,
+ SingleRecipientNoInputs,
+ NoRecipients,
+ NoUtxosSelected,
+ OutputBelowDustLimit(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
+ InsufficientFunds,
+ BnBTotalTriesExceeded,
+ BnBNoExactMatch,
+ UnknownUTXO,
+ TransactionNotFound,
+ TransactionConfirmed,
+ IrreplaceableTransaction,
+ FeeRateTooLow {
+ required: <a class="struct" href="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>,
+ },
+ FeeTooLow {
+ required: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
+ },
+ MissingKeyOrigin(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ Key(<a class="enum" href="../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>),
+ ChecksumMismatch,
+ SpendingPolicyRequired(<a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>),
+ 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>),
+ OfflineClient,
+ InvalidProgressValue(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>),
+ ProgressUpdateError,
+ 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.60/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="../bdk/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.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 class="docblock"><p>Wrong number of bytes found when trying to convert to u32</p>
+</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 class="docblock"><p>Generic error</p>
+</div><div id="variant.ScriptDoesntHaveAddressForm" class="variant small-section-header"><a href="#variant.ScriptDoesntHaveAddressForm" class="anchor field"></a><code>ScriptDoesntHaveAddressForm</code></div><div class="docblock"><p>This error is thrown when trying to convert Bare and Public key script to address</p>
+</div><div id="variant.SingleRecipientMultipleOutputs" class="variant small-section-header"><a href="#variant.SingleRecipientMultipleOutputs" class="anchor field"></a><code>SingleRecipientMultipleOutputs</code></div><div class="docblock"><p>Found multiple outputs when <code>single_recipient</code> option has been specified</p>
+</div><div id="variant.SingleRecipientNoInputs" class="variant small-section-header"><a href="#variant.SingleRecipientNoInputs" class="anchor field"></a><code>SingleRecipientNoInputs</code></div><div class="docblock"><p><code>single_recipient</code> option is selected but neither <code>drain_wallet</code> nor <code>manually_selected_only</code> are</p>
+</div><div id="variant.NoRecipients" class="variant small-section-header"><a href="#variant.NoRecipients" class="anchor field"></a><code>NoRecipients</code></div><div class="docblock"><p>Cannot build a tx without recipients</p>
+</div><div id="variant.NoUtxosSelected" class="variant small-section-header"><a href="#variant.NoUtxosSelected" class="anchor field"></a><code>NoUtxosSelected</code></div><div class="docblock"><p><code>manually_selected_only</code> option is selected but no utxo has been passed</p>
+</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 class="docblock"><p>Output created is under the dust limit, 546 satoshis</p>
+</div><div id="variant.InsufficientFunds" class="variant small-section-header"><a href="#variant.InsufficientFunds" class="anchor field"></a><code>InsufficientFunds</code></div><div class="docblock"><p>Wallet's UTXO set is not enough to cover recipient's requested plus fee</p>
+</div><div id="variant.BnBTotalTriesExceeded" class="variant small-section-header"><a href="#variant.BnBTotalTriesExceeded" class="anchor field"></a><code>BnBTotalTriesExceeded</code></div><div class="docblock"><p>Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow
+exponentially, thus a limit is set, and when hit, this error is thrown</p>
+</div><div id="variant.BnBNoExactMatch" class="variant small-section-header"><a href="#variant.BnBNoExactMatch" class="anchor field"></a><code>BnBNoExactMatch</code></div><div class="docblock"><p>Branch and bound coin selection tries to avoid needing a change by finding the right inputs for
+the desired outputs plus fee, if there is not such combination this error is thrown</p>
+</div><div id="variant.UnknownUTXO" class="variant small-section-header"><a href="#variant.UnknownUTXO" class="anchor field"></a><code>UnknownUTXO</code></div><div class="docblock"><p>Happens when trying to spend an UTXO that is not in the internal database</p>
+</div><div id="variant.TransactionNotFound" class="variant small-section-header"><a href="#variant.TransactionNotFound" class="anchor field"></a><code>TransactionNotFound</code></div><div class="docblock"><p>Thrown when a tx is not found in the internal database</p>
+</div><div id="variant.TransactionConfirmed" class="variant small-section-header"><a href="#variant.TransactionConfirmed" class="anchor field"></a><code>TransactionConfirmed</code></div><div class="docblock"><p>Happens when trying to bump a transaction that is already confirmed</p>
+</div><div id="variant.IrreplaceableTransaction" class="variant small-section-header"><a href="#variant.IrreplaceableTransaction" class="anchor field"></a><code>IrreplaceableTransaction</code></div><div class="docblock"><p>Trying to replace a tx that has a sequence >= <code>0xFFFFFFFE</code></p>
+</div><div id="variant.FeeRateTooLow" class="variant small-section-header"><a href="#variant.FeeRateTooLow" class="anchor field"></a><code>FeeRateTooLow</code></div><div class="docblock"><p>When bumping a tx the fee rate requested is lower than required</p>
+</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="../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a></code></span><div class="docblock"><p>Required fee rate (satoshi/vbyte)</p>
+</div></div></div><div id="variant.FeeTooLow" class="variant small-section-header"><a href="#variant.FeeTooLow" class="anchor field"></a><code>FeeTooLow</code></div><div class="docblock"><p>When bumping a tx the absolute fee requested is lower than replaced tx absolute fee</p>
+</div><div class="autohide sub-variant" id="variant.FeeTooLow.fields"><h3>Fields of <b>FeeTooLow</b></h3><div><span id="variant.FeeTooLow.field.required" class="variant small-section-header"><a href="#variant.FeeTooLow.field.required" class="anchor field"></a><code>required: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code></span><div class="docblock"><p>Required fee absolute value (satoshi)</p>
+</div></div></div><div id="variant.MissingKeyOrigin" class="variant small-section-header"><a href="#variant.MissingKeyOrigin" class="anchor field"></a><code>MissingKeyOrigin(<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 class="docblock"><p>In order to use the <a href="../bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_global_xpubs"><code>TxBuilder::add_global_xpubs</code></a> option every extended
+key in the descriptor must either be a master key itself (having depth = 0) or have an
+explicit origin provided</p>
+</div><div id="variant.Key" class="variant small-section-header"><a href="#variant.Key" class="anchor field"></a><code>Key(<a class="enum" href="../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>)</code></div><div class="docblock"><p>Error while working with <a href="../bdk/keys/index.html"><code>keys</code></a></p>
+</div><div id="variant.ChecksumMismatch" class="variant small-section-header"><a href="#variant.ChecksumMismatch" class="anchor field"></a><code>ChecksumMismatch</code></div><div class="docblock"><p>Descriptor checksum mismatch</p>
+</div><div id="variant.SpendingPolicyRequired" class="variant small-section-header"><a href="#variant.SpendingPolicyRequired" class="anchor field"></a><code>SpendingPolicyRequired(<a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>)</code></div><div class="docblock"><p>Spending policy is not compatible with this <a href="../bdk/enum.KeychainKind.html"><code>KeychainKind</code></a></p>
+</div><div id="variant.InvalidPolicyPathError" class="variant small-section-header"><a href="#variant.InvalidPolicyPathError" class="anchor field"></a><code>InvalidPolicyPathError(<a class="enum" href="../bdk/descriptor/policy/enum.PolicyError.html" title="enum bdk::descriptor::policy::PolicyError">PolicyError</a>)</code></div><div class="docblock"><p>Error while extracting and manipulating policies</p>
+</div><div id="variant.Signer" class="variant small-section-header"><a href="#variant.Signer" class="anchor field"></a><code>Signer(<a class="enum" href="../bdk/wallet/signer/enum.SignerError.html" title="enum bdk::wallet::signer::SignerError">SignerError</a>)</code></div><div class="docblock"><p>Signing error</p>
+</div><div id="variant.OfflineClient" class="variant small-section-header"><a href="#variant.OfflineClient" class="anchor field"></a><code>OfflineClient</code></div><div class="docblock"><p>Thrown when trying to call a method that requires a network connection, <a href="../bdk/wallet/struct.Wallet.html#method.sync"><code>Wallet::sync</code></a> and <a href="../bdk/wallet/struct.Wallet.html#method.broadcast"><code>Wallet::broadcast</code></a>
+This error is thrown when creating the Client for the first time, while recovery attempts are tried
+during the sync</p>
+</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 class="docblock"><p>Progress value must be between <code>0.0</code> (included) and <code>100.0</code> (included)</p>
+</div><div id="variant.ProgressUpdateError" class="variant small-section-header"><a href="#variant.ProgressUpdateError" class="anchor field"></a><code>ProgressUpdateError</code></div><div class="docblock"><p>Progress update error (maybe the channel has been closed)</p>
+</div><div id="variant.InvalidOutpoint" class="variant small-section-header"><a href="#variant.InvalidOutpoint" class="anchor field"></a><code>InvalidOutpoint(OutPoint)</code></div><div class="docblock"><p>Requested outpoint doesn't exist in the tx (vout greater than available outputs)</p>
+</div><div id="variant.Descriptor" class="variant small-section-header"><a href="#variant.Descriptor" class="anchor field"></a><code>Descriptor(<a class="enum" href="../bdk/descriptor/error/enum.Error.html" title="enum bdk::descriptor::error::Error">Error</a>)</code></div><div class="docblock"><p>Error related to the parsing and usage of descriptors</p>
+</div><div id="variant.AddressValidator" class="variant small-section-header"><a href="#variant.AddressValidator" class="anchor field"></a><code>AddressValidator(<a class="enum" href="../bdk/wallet/address_validator/enum.AddressValidatorError.html" title="enum bdk::wallet::address_validator::AddressValidatorError">AddressValidatorError</a>)</code></div><div class="docblock"><p>Error that can be returned to fail the validation of an address</p>
+</div><div id="variant.Encode" class="variant small-section-header"><a href="#variant.Encode" class="anchor field"></a><code>Encode(Error)</code></div><div class="docblock"><p>Encoding error</p>
+</div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code>Miniscript(Error)</code></div><div class="docblock"><p>Miniscript error</p>
+</div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code>BIP32(Error)</code></div><div class="docblock"><p>BIP32 error</p>
+</div><div id="variant.Secp256k1" class="variant small-section-header"><a href="#variant.Secp256k1" class="anchor field"></a><code>Secp256k1(Error)</code></div><div class="docblock"><p>An ECDSA error</p>
+</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.60/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>)</code></div><div class="docblock"><p>Error serializing or deserializing JSON data</p>
+</div><div id="variant.Hex" class="variant small-section-header"><a href="#variant.Hex" class="anchor field"></a><code>Hex(Error)</code></div><div class="docblock"><p>Hex decoding error</p>
+</div><div id="variant.PSBT" class="variant small-section-header"><a href="#variant.PSBT" class="anchor field"></a><code>PSBT(Error)</code></div><div class="docblock"><p>Partially signed bitcoin transaction error</p>
+</div><div id="variant.Electrum" class="variant small-section-header"><a href="#variant.Electrum" class="anchor field"></a><code>Electrum(Error)</code></div><div class="docblock"><p>Electrum client error</p>
+</div><div id="variant.Esplora" class="variant small-section-header"><a href="#variant.Esplora" class="anchor field"></a><code>Esplora(<a class="enum" href="../bdk/blockchain/esplora/enum.EsploraError.html" title="enum bdk::blockchain::esplora::EsploraError">EsploraError</a>)</code></div><div class="docblock"><p>Esplora client error</p>
+</div><div id="variant.CompactFilters" class="variant small-section-header"><a href="#variant.CompactFilters" class="anchor field"></a><code>CompactFilters(<a class="enum" href="../bdk/blockchain/compact_filters/enum.CompactFiltersError.html" title="enum bdk::blockchain::compact_filters::CompactFiltersError">CompactFiltersError</a>)</code></div><div class="docblock"><p>Compact filters client error)</p>
+</div><div id="variant.Sled" class="variant small-section-header"><a href="#variant.Sled" class="anchor field"></a><code>Sled(Error)</code></div><div class="docblock"><p>Sled database error</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/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#31" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#31" 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#144-148" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#145-147" 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#150" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#166" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#166" 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#197-204" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-15" class="method hidden"><code>pub 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#198-203" 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#165" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#165" 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#181" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-5" class="method hidden"><code>pub 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#181" 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#576-580" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>compact_filters</code></strong> only.</div></div><div class="impl-items"><h4 id="method.from-16" class="method hidden"><code>pub 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#577-579" 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#182" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-6" class="method hidden"><code>pub 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#182" 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#183" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-7" class="method hidden"><code>pub 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#183" 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#184" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-8" class="method hidden"><code>pub 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#184" 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.60/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#185" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-9" class="method hidden"><code>pub 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.60/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#185" 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#186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-10" class="method hidden"><code>pub 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#186" 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#187" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-11" class="method hidden"><code>pub 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#187" 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#190" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-12" class="method hidden"><code>pub 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#190" 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#194" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-14" class="method hidden"><code>pub 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#194" 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#192" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-13" class="method hidden"><code>pub 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#192" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CKeyError%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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>> for <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href="#impl-From%3CKeyError%3E" class="anchor"></a><a class="srclink" href="../src/bdk/error.rs.html#170-179" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(key_error: <a class="enum" href="../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>) -> <a class="enum" href="../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a class="srclink" href="../src/bdk/error.rs.html#171-178" 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#167" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#167" 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#168" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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#168" 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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-17" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `KeychainKind` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, KeychainKind"><title>bdk::KeychainKind - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Enum KeychainKind</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></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%3CKeychainKind%3E">PartialEq<KeychainKind></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%2C%20Global%3E%3E">CheckBase32<Vec<u5, Global>></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "KeychainKind", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-39" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="index.html">bdk</a>::<wbr><a class="enum" href="">KeychainKind</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum KeychainKind {
+ External,
+ Internal,
+}</pre></div><div class="docblock"><p>Types of keychains</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 class="docblock"><p>External</p>
+</div><div id="variant.Internal" class="variant small-section-header"><a href="#variant.Internal" class="anchor field"></a><code>Internal</code></div><div class="docblock"><p>Internal, usually used for change outputs</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/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/bdk/types.rs.html#41-49" 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/bdk/types.rs.html#43-48" title="goto source code">[src]</a></h4><div class="docblock"><p>Return <a href="../bdk/enum.KeychainKind.html" title="KeychainKind"><code>KeychainKind</code></a> as a byte</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-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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-AsRef%3C%5Bu8%5D%3E" class="anchor"></a><a class="srclink" href="../src/bdk/types.rs.html#51-58" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_ref" class="method hidden"><code>pub 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#52-57" 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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#128-130" 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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.118/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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%3CKeychainKind%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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>> for <a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-PartialEq%3CKeychainKind%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>pub 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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><span class="docblock attributes">#[must_use]</span>pub 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#209-211" 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.118/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/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.118/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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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%2C%20Global%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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>> 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%2C%20Global%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>pub fn <a href="#method.check_base32" class="fnname">check_base32</a>(<br> self<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><u5, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>>>::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.118/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.118/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.118/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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub fn <a href="#method.write_base32" class="fnname">write_base32</a><W>(<br> &self, <br> writer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W<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>, <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>pub 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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><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></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%2C%20Global%3E%3E">CheckBase32<Vec<u5, Global>></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-39" 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>External</code></div><div class="docblock"><p>External</p>
+</div><div id="variant.Internal" class="variant small-section-header"><a href="#variant.Internal" class="anchor field"></a><code>Internal</code></div><div class="docblock"><p>Internal, usually used for change outputs</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/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#41-48" 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/bdk/types.rs.html#42-47" 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#50-57" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_ref" class="method hidden"><code>pub 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#51-56" 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>pub 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>pub 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#128-130" 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>pub 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.118/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>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/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>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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><span class="docblock attributes">#[must_use]</span>pub 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#209-211" 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.118/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>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/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.118/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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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%2C%20Global%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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>> 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%2C%20Global%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>pub fn <a href="#method.check_base32" class="fnname">check_base32</a>(<br> self<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><u5, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>>>::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.118/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.118/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.118/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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub fn <a href="#method.write_base32" class="fnname">write_base32</a><W>(<br> &self, <br> writer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>W<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>, <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>pub 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, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate bdk</p><div class="block version"><p>Version 0.1.0</p></div><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="#macros">Macros</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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#26-271" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">bdk</a></span></h1><div class="docblock"><p>A modern, lightweight, descriptor-based wallet library written in Rust.</p>
+<h1 id="about" class="section-header"><a href="#about">About</a></h1>
+<p>The BDK library aims to be the core building block for Bitcoin wallets of any kind.</p>
+<ul>
+<li>It uses <a href="https://github.com/rust-bitcoin/rust-miniscript">Miniscript</a> to support descriptors with generalized conditions. This exact same library can be used to build
+single-sig wallets, multisigs, timelocked contracts and more.</li>
+<li>It supports multiple blockchain backends and databases, allowing developers to choose exactly what's right for their projects.</li>
+<li>It is built to be cross-platform: the core logic works on desktop, mobile, and even WebAssembly.</li>
+<li>It is very easy to extend: developers can implement customized logic for blockchain backends, databases, signers, coin selection, and more, without having to fork and modify this library.</li>
+</ul>
+<h1 id="a-tour-of-bdk" class="section-header"><a href="#a-tour-of-bdk">A Tour of BDK</a></h1>
+<p>BDK consists of a number of modules that provide a range of functionality
+essential for implementing descriptor based Bitcoin wallet applications in Rust. In this
+section, we will take a brief tour of BDK, summarizing the major APIs and
+their uses.</p>
+<p>The easiest way to get started is to add bdk to your dependencies with the default features.
+The default features include a simple key-value database (<a href="sled"><code>sled</code></a>) to cache
+blockchain data and an <a href="https://docs.rs/electrum-client/">electrum</a> blockchain client to
+interact with the bitcoin P2P network.</p>
+<pre><code class="language-toml">bdk = "0.2.0"
+</code></pre>
+<h2 id="sync-the-balance-of-a-descriptor" class="section-header"><a href="#sync-the-balance-of-a-descriptor">Sync the balance of a descriptor</a></h2><h3 id="example" class="section-header"><a href="#example">Example</a></h3>
+<div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore">
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">Wallet</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">database</span>::<span class="ident">MemoryDatabase</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">blockchain</span>::{<span class="ident">noop_progress</span>, <span class="ident">ElectrumBlockchain</span>};
+
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">electrum_client</span>::<span class="ident">Client</span>;
+
+<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">bdk</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">Client</span>::<span class="ident">new</span>(<span class="string">"ssl://electrum.blockstream.info:60002"</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">wallet</span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new</span>(
+ <span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)"</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"</span>),
+ <span class="ident">bitcoin</span>::<span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>(),
+ <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">client</span>)
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">wallet</span>.<span class="ident">sync</span>(<span class="ident">noop_progress</span>(), <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
+
+ <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Descriptor balance: {} SAT"</span>, <span class="ident">wallet</span>.<span class="ident">get_balance</span>()<span class="question-mark">?</span>);
+
+ <span class="prelude-val">Ok</span>(())
+}</pre></div>
+<h2 id="generate-a-few-addresses" class="section-header"><a href="#generate-a-few-addresses">Generate a few addresses</a></h2><h3 id="example-1" class="section-header"><a href="#example-1">Example</a></h3>
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">use</span> <span class="ident">bdk</span>::{<span class="ident">Wallet</span>, <span class="ident">OfflineWallet</span>};
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">database</span>::<span class="ident">MemoryDatabase</span>;
+
+<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">bdk</span>::<span class="ident">Error</span><span class="op">></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([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)"</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"</span>),
+ <span class="ident">bitcoin</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="macro">println</span><span class="macro">!</span>(<span class="string">"Address #0: {}"</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 #1: {}"</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 #2: {}"</span>, <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</span>);
+
+ <span class="prelude-val">Ok</span>(())
+}</pre></div>
+<h2 id="create-a-transaction" class="section-header"><a href="#create-a-transaction">Create a transaction</a></h2><h3 id="example-2" class="section-header"><a href="#example-2">Example</a></h3>
+<div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore">
+<span class="kw">use</span> <span class="ident">base64</span>::<span class="ident">decode</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::{<span class="ident">FeeRate</span>, <span class="ident">TxBuilder</span>, <span class="ident">Wallet</span>};
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">database</span>::<span class="ident">MemoryDatabase</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">blockchain</span>::{<span class="ident">noop_progress</span>, <span class="ident">ElectrumBlockchain</span>};
+
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">electrum_client</span>::<span class="ident">Client</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">serialize</span>;
+
+<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">bdk</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">Client</span>::<span class="ident">new</span>(<span class="string">"ssl://electrum.blockstream.info:60002"</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">wallet</span> <span class="op">=</span> <span class="ident">Wallet</span>::<span class="ident">new</span>(
+ <span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)"</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"</span>),
+ <span class="ident">bitcoin</span>::<span class="ident">Network</span>::<span class="ident">Testnet</span>,
+ <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>(),
+ <span class="ident">ElectrumBlockchain</span>::<span class="ident">from</span>(<span class="ident">client</span>)
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">wallet</span>.<span class="ident">sync</span>(<span class="ident">noop_progress</span>(), <span class="prelude-val">None</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">send_to</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">get_new_address</span>()<span class="question-mark">?</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">send_to</span>.<span class="ident">script_pubkey</span>(), <span class="number">50_000</span>)])
+ .<span class="ident">enable_rbf</span>()
+ .<span class="ident">do_not_spend_change</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="macro">println</span><span class="macro">!</span>(<span class="string">"Transaction details: {:#?}"</span>, <span class="ident">details</span>);
+ <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Unsigned PSBT: {}"</span>, <span class="ident">base64</span>::<span class="ident">encode</span>(<span class="kw-2">&</span><span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">psbt</span>)));
+
+ <span class="prelude-val">Ok</span>(())
+}</pre></div>
+<h2 id="sign-a-transaction" class="section-header"><a href="#sign-a-transaction">Sign a transaction</a></h2><h3 id="example-3" class="section-header"><a href="#example-3">Example</a></h3>
+<div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore">
+<span class="kw">use</span> <span class="ident">base64</span>::<span class="ident">decode</span>;
+<span class="kw">use</span> <span class="ident">bdk</span>::{<span class="ident">Wallet</span>, <span class="ident">OfflineWallet</span>};
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">database</span>::<span class="ident">MemoryDatabase</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">consensus</span>::<span class="ident">deserialize</span>;
+
+<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">bdk</span>::<span class="ident">Error</span><span class="op">></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([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/0/*)"</span>,
+ <span class="prelude-val">Some</span>(<span class="string">"wpkh([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/1/*)"</span>),
+ <span class="ident">bitcoin</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">psbt</span> <span class="op">=</span> <span class="string">"..."</span>;
+ <span class="kw">let</span> <span class="ident">psbt</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">base64</span>::<span class="ident">decode</span>(<span class="ident">psbt</span>).<span class="ident">unwrap</span>())<span class="question-mark">?</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="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+}</pre></div>
+<h1 id="feature-flags" class="section-header"><a href="#feature-flags">Feature flags</a></h1>
+<p>BDK uses a set of <a href="https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section">feature flags</a>
+to reduce the amount of compiled code by allowing projects to only enable the features they need.
+By default, BDK enables two internal features, <code>key-value-db</code> and <code>electrum</code>.</p>
+<p>If you are new to BDK we recommended that you use the default features which will enable
+basic descriptor wallet functionality. More advanced users can disable the <code>default</code> features
+(<code>--no-default-features</code>) and build the BDK library with only the features you need.
+Below is a list of the available feature flags and the additional functionality they provide.</p>
+<ul>
+<li><code>all-keys</code>: all features for working with bitcoin keys</li>
+<li><code>async-interface</code>: async functions in bdk traits</li>
+<li><code>cli-utils</code>: utilities for creating a command line interface wallet</li>
+<li><code>keys-bip39</code>: <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">BIP-39</a> mnemonic codes for generating deterministic keys</li>
+</ul>
+<h2 id="internal-features" class="section-header"><a href="#internal-features">Internal features</a></h2>
+<p>These features do not expose any new API, but influence internal implementation aspects of
+BDK.</p>
+<ul>
+<li><code>compact_filters</code>: <a href="../bdk/blockchain/compact_filters/index.html"><code>compact_filters</code></a> client protocol for interacting with the bitcoin P2P network</li>
+<li><code>electrum</code>: <a href="../bdk/blockchain/electrum/index.html"><code>electrum</code></a> client protocol for interacting with electrum servers</li>
+<li><code>esplora</code>: <a href="../bdk/blockchain/esplora/index.html"><code>esplora</code></a> client protocol for interacting with blockstream <a href="https://github.com/Blockstream/electrs">electrs</a> servers</li>
+<li><code>key-value-db</code>: key value <a href="../bdk/database/index.html"><code>database</code></a> based on <a href="crate::sled"><code>sled</code></a> for caching blockchain data</li>
+</ul>
+</div><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.10/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="mod" href="../bdk/descriptor/template/index.html" title="mod bdk::descriptor::template">template</a>;</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="keys/index.html" title="bdk::keys mod">keys</a></td><td class="docblock-short"><p>Key formats</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="macros" class="section-header"><a href="#macros">Macros</a></h2>
+<table><tr class="module-item"><td><a class="macro" href="macro.descriptor.html" title="bdk::descriptor macro">descriptor</a></td><td class="docblock-short"><p>Macro to write full descriptors with code</p>
+</td></tr><tr class="module-item"><td><a class="macro" href="macro.fragment.html" title="bdk::fragment macro">fragment</a></td><td class="docblock-short"><p>Macro to write descriptor fragments with code</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="../bdk/wallet/struct.Wallet.html"><code>Wallet</code></a></p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.KeychainKind.html" title="bdk::KeychainKind enum">KeychainKind</a></td><td class="docblock-short"><p>Types of keychains</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 `bip39` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, bip39"><title>bdk::keys::bip39 - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module bip39</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#types">Type Definitions</a></li></ul></div><p class="location"><a href="../../index.html">bdk</a>::<wbr><a href="../index.html">keys</a></p><script>window.sidebarCurrent = {name: "bip39", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/bip39.rs.html#25-173" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">keys</a>::<wbr><a class="mod" href="">bip39</a></span></h1><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="docblock"><p>BIP-0039</p>
+</div><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
+<table><tr class="module-item"><td><a class="type" href="type.MnemonicWithPassphrase.html" title="bdk::keys::bip39::MnemonicWithPassphrase type">MnemonicWithPassphrase</a></td><td class="docblock-short"><p>Type for a BIP39 mnemonic with an optional passphrase</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({"type":[["MnemonicWithPassphrase","Type for a BIP39 mnemonic with an optional passphrase"]]});
\ 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 `MnemonicWithPassphrase` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, MnemonicWithPassphrase"><title>bdk::keys::bip39::MnemonicWithPassphrase - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition MnemonicWithPassphrase</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-DerivableKey%3CCtx%3E">DerivableKey<Ctx></a></div></div><p class="location"><a href="../../index.html">bdk</a>::<wbr><a href="../index.html">keys</a>::<wbr><a href="index.html">bip39</a></p><script>window.sidebarCurrent = {name: "MnemonicWithPassphrase", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/bip39.rs.html#40" title="goto source code">[src]</a></span><span class="in-band">Type Definition <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">keys</a>::<wbr><a href="index.html">bip39</a>::<wbr><a class="type" href="">MnemonicWithPassphrase</a></span></h1><pre class="rust typedef">type MnemonicWithPassphrase = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Mnemonic, <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="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="docblock"><p>Type for a BIP39 mnemonic with an optional passphrase</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-DerivableKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for <a class="type" href="../../../bdk/keys/bip39/type.MnemonicWithPassphrase.html" title="type bdk::keys::bip39::MnemonicWithPassphrase">MnemonicWithPassphrase</a></code><a href="#impl-DerivableKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/keys/bip39.rs.html#60-70" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_metadata" class="method hidden"><code>pub fn <a href="../../../bdk/keys/trait.DerivableKey.html#tymethod.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../../src/bdk/keys/bip39.rs.html#61-69" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Add a extra metadata, consume <code>self</code> and turn it into a <a href="../../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a></p>
+</div></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 `DescriptorKey` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorKey"><title>bdk::keys::DescriptorKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum DescriptorKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.from_public">from_public</a><a href="#method.from_secret">from_secret</a><a href="#method.override_valid_networks">override_valid_networks</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-ToDescriptorKey%3CCtx%3E">ToDescriptorKey<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-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "DescriptorKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#77-82" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="enum" href="">DescriptorKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum DescriptorKey<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> {
+ // some variants omitted
+}</pre></div><div class="docblock"><p>Container for public or secret keys</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<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#84-127" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from_public" class="method"><code>pub fn <a href="#method.from_public" class="fnname">from_public</a>(public: <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, networks: <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a>) -> Self</code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#86-88" title="goto source code">[src]</a></h4><div class="docblock"><p>Create an instance given a public key and a set of valid networks</p>
+</div><h4 id="method.from_secret" class="method"><code>pub fn <a href="#method.from_secret" class="fnname">from_secret</a>(secret: <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, networks: <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a>) -> Self</code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#91-93" title="goto source code">[src]</a></h4><div class="docblock"><p>Create an instance given a secret key and a set of valid networks</p>
+</div><h4 id="method.override_valid_networks" class="method"><code>pub fn <a href="#method.override_valid_networks" class="fnname">override_valid_networks</a>(self, networks: <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a>) -> Self</code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#96-101" title="goto source code">[src]</a></h4><div class="docblock"><p>Override the computed set of valid networks</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<Ctx: <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/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/keys/mod.rs.html#76" 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-ToDescriptorKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx></code><a href="#impl-ToDescriptorKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#620-624" title="goto source code">[src]</a></h3><div class="docblock"><p>The "identity" conversion is used internally by some <code>bdk::fragment</code>s</p>
+</div><div class="impl-items"><h4 id="method.to_descriptor_key" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ToDescriptorKey.html#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#621-623" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn the key into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a> within the requested <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></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<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><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>, </span></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><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>, </span></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx> <span class="where fmt-newline">where<br> Ctx: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><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>, </span></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx> <span class="where fmt-newline">where<br> Ctx: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `DescriptorPublicKey` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorPublicKey"><title>bdk::keys::DescriptorPublicKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum DescriptorPublicKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.SinglePub">SinglePub</a><a href="#variant.XPub">XPub</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.derive">derive</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-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-MiniscriptKey">MiniscriptKey</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CDescriptorPublicKey%3E">PartialEq<DescriptorPublicKey></a><a href="#impl-PartialOrd%3CDescriptorPublicKey%3E">PartialOrd<DescriptorPublicKey></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-ToDescriptorKey%3CCtx%3E">ToDescriptorKey<Ctx></a><a href="#impl-ToPublicKey%3CDescriptorPublicKeyCtx%3C%27secp%2C%20C%3E%3E">ToPublicKey<DescriptorPublicKeyCtx<'secp, C>></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "DescriptorPublicKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</a>::<wbr><a class="enum" href="">DescriptorPublicKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum DescriptorPublicKey {
+ SinglePub(<a class="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a>),
+ XPub(DescriptorXKey<ExtendedPubKey>),
+}</pre></div><div class="docblock"><p>The MiniscriptKey corresponding to Descriptors. This can
+either be Single public key or a Xpub</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.SinglePub" class="variant small-section-header"><a href="#variant.SinglePub" class="anchor field"></a><code>SinglePub(<a class="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a>)</code></div><div class="docblock"><p>Single Public Key</p>
+</div><div id="variant.XPub" class="variant small-section-header"><a href="#variant.XPub" class="anchor field"></a><code>XPub(DescriptorXKey<ExtendedPubKey>)</code></div><div class="docblock"><p>Xpub</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl" 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, child_number: ChildNumber) -> <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code></h4><div class="docblock"><p>Derives the specified child key if self is a wildcard xpub. Otherwise returns self.</p>
+<p>Panics if given a hardened child number</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="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Clone" class="anchor"></a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>pub 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#128-130" 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Debug" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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 <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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Display" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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 <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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Eq" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></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/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = DescriptorKeyParseError</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>pub fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</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="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>></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/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
+</div></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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Hash" class="anchor"></a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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-MiniscriptKey" 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="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-MiniscriptKey" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Hash" class="type"><code>type <a href="../../bdk/descriptor/trait.MiniscriptKey.html#associatedtype.Hash" class="type">Hash</a> = <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code></h4><div class='docblock'><p>The associated Hash type with the publicKey</p>
+</div><h4 id="method.to_pubkeyhash" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.MiniscriptKey.html#tymethod.to_pubkeyhash" class="fnname">to_pubkeyhash</a>(&self) -> <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code></h4><div class='docblock hidden'><p>Converts an object to PublicHash</p>
+</div><h4 id="method.is_uncompressed" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.MiniscriptKey.html#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 hidden'><p>Check if the publicKey is uncompressed. The default
+implementation returns false <a href="../../bdk/descriptor/trait.MiniscriptKey.html#method.is_uncompressed">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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Ord" class="anchor"></a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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%3CDescriptorPublicKey%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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-PartialEq%3CDescriptorPublicKey%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>!=</code>.</p>
+</div></div><h3 id="impl-PartialOrd%3CDescriptorPublicKey%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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-PartialOrd%3CDescriptorPublicKey%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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 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>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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 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>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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 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>pub 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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 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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-ToDescriptorKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#626-640" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ToDescriptorKey.html#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#627-639" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn the key into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a> within the requested <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a></p>
+</div></div><h3 id="impl-ToPublicKey%3CDescriptorPublicKeyCtx%3C%27secp%2C%20C%3E%3E" class="impl"><code class="in-band">impl<'secp, C> <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><DescriptorPublicKeyCtx<'secp, C>> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a> <span class="where fmt-newline">where<br> C: Verification, </span></code><a href="#impl-ToPublicKey%3CDescriptorPublicKeyCtx%3C%27secp%2C%20C%3E%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.to_public_key" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ToPublicKey.html#tymethod.to_public_key" class="fnname">to_public_key</a>(<br> &self, <br> to_pk_ctx: DescriptorPublicKeyCtx<'secp, C><br>) -> PublicKey</code></h4><div class='docblock hidden'><p>Converts an object to a public key
+C represents additional context information that maybe
+required for deriving a bitcoin::PublicKey from MiniscriptKey
+You may require secp context for crypto operations
+or additional information for substituting the wildcard in
+extended pubkeys <a href="../../bdk/descriptor/trait.ToPublicKey.html#tymethod.to_public_key">Read more</a></p>
+</div><h4 id="method.hash_to_hash160" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ToPublicKey.html#tymethod.hash_to_hash160" class="fnname">hash_to_hash160</a>(<br> hash: &<<a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</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>, <br> to_pk_ctx: DescriptorPublicKeyCtx<'secp, C><br>) -> Hash</code></h4><div class='docblock hidden'><p>Converts a hashed version of the public key to a <code>hash160</code> hash. <a href="../../bdk/descriptor/trait.ToPublicKey.html#tymethod.hash_to_hash160">Read more</a></p>
+</div><h4 id="method.serialized_len" class="method hidden"><code>pub fn <a href="../../bdk/descriptor/trait.ToPublicKey.html#method.serialized_len" class="fnname">serialized_len</a>(&self, to_pk_ctx: ToPkCtx) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Computes the size of a public key when serialized in a script,
+including the length bytes <a href="../../bdk/descriptor/trait.ToPublicKey.html#method.serialized_len">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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `DescriptorSecretKey` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorSecretKey"><title>bdk::keys::DescriptorSecretKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum DescriptorSecretKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.SinglePriv">SinglePriv</a><a href="#variant.XPrv">XPrv</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.as_public">as_public</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-FromStr">FromStr</a><a href="#impl-ToDescriptorKey%3CCtx%3E">ToDescriptorKey<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-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "DescriptorSecretKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</a>::<wbr><a class="enum" href="">DescriptorSecretKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum DescriptorSecretKey {
+ SinglePriv(<a class="struct" href="../../bdk/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a>),
+ XPrv(DescriptorXKey<ExtendedPrivKey>),
+}</pre></div><div class="docblock"><p>A Secret Key that can be either a single key or an Xprv</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.SinglePriv" class="variant small-section-header"><a href="#variant.SinglePriv" class="anchor field"></a><code>SinglePriv(<a class="struct" href="../../bdk/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a>)</code></div><div class="docblock"><p>Single Secret Key</p>
+</div><div id="variant.XPrv" class="variant small-section-header"><a href="#variant.XPrv" class="anchor field"></a><code>XPrv(DescriptorXKey<ExtendedPrivKey>)</code></div><div class="docblock"><p>Xprv</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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl" class="anchor"></a></h3><div class="impl-items"><h4 id="method.as_public" class="method"><code>pub fn <a href="#method.as_public" class="fnname">as_public</a><C>(<br> &self, <br> secp: &Secp256k1<C><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/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, DescriptorKeyParseError> <span class="where fmt-newline">where<br> C: Signing, </span></code></h4><div class="docblock"><p>Return the public version of this key, by applying either
+<a href="../../bdk/keys/struct.DescriptorSinglePriv.html#method.as_public" title="DescriptorSinglePriv::as_public"><code>DescriptorSinglePriv::as_public</code></a> or [<code>DescriptorXKey<bip32::ExtendedPrivKey>::as_public</code>]
+depending on the type of key.</p>
+<p>If the key is an "XPrv", the hardened derivation steps will be applied before converting it
+to a public key. See the documentation of [<code>DescriptorXKey<bip32::ExtendedPrivKey>::as_public</code>]
+for more details.</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="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-Debug" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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 <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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-Display" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></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/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = DescriptorKeyParseError</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>pub fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</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="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <<a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>></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/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
+</div></div><h3 id="impl-ToDescriptorKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#652-668" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ToDescriptorKey.html#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#653-667" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn the key into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a> within the requested <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `KeyError` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, KeyError"><title>bdk::keys::KeyError - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum KeyError</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.InvalidChecksum">InvalidChecksum</a><a href="#variant.InvalidNetwork">InvalidNetwork</a><a href="#variant.InvalidScriptContext">InvalidScriptContext</a><a href="#variant.Message">Message</a><a href="#variant.Miniscript">Miniscript</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%3CKeyError%3E">From<KeyError></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "KeyError", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#682-697" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="enum" href="">KeyError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum KeyError {
+ InvalidScriptContext,
+ InvalidNetwork,
+ InvalidChecksum,
+ Message(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
+ BIP32(Error),
+ Miniscript(Error),
+}</pre></div><div class="docblock"><p>Errors thrown while working with <a href="../../bdk/keys/index.html"><code>keys</code></a></p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.InvalidScriptContext" class="variant small-section-header"><a href="#variant.InvalidScriptContext" class="anchor field"></a><code>InvalidScriptContext</code></div><div class="docblock"><p>The key cannot exist in the given script context</p>
+</div><div id="variant.InvalidNetwork" class="variant small-section-header"><a href="#variant.InvalidNetwork" class="anchor field"></a><code>InvalidNetwork</code></div><div class="docblock"><p>The key is not valid for the given network</p>
+</div><div id="variant.InvalidChecksum" class="variant small-section-header"><a href="#variant.InvalidChecksum" class="anchor field"></a><code>InvalidChecksum</code></div><div class="docblock"><p>The key has an invalid checksum</p>
+</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><div class="docblock"><p>Custom error message</p>
+</div><div id="variant.BIP32" class="variant small-section-header"><a href="#variant.BIP32" class="anchor field"></a><code>BIP32(Error)</code></div><div class="docblock"><p>BIP32 error</p>
+</div><div id="variant.Miniscript" class="variant small-section-header"><a href="#variant.Miniscript" class="anchor field"></a><code>Miniscript(Error)</code></div><div class="docblock"><p>Miniscript error</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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#681" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/keys/mod.rs.html#681" 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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#702-706" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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/keys/mod.rs.html#703-705" 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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Error" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#708" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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><Error> for <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-From%3CError%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#699" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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/keys/mod.rs.html#699" 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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-From%3CError%3E-1" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#700" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-3" class="method hidden"><code>pub 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/keys/mod.rs.html#700" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CKeyError%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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>> for <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a href="#impl-From%3CKeyError%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/error.rs.html#170-179" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(key_error: <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>) -> <a class="enum" href="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a></code><a class="srclink" href="../../src/bdk/error.rs.html#171-178" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-From%3CKeyError%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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</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%3CKeyError%3E-1" class="anchor"></a><a class="srclink" href="../../src/bdk/descriptor/error.rs.html#62-70" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(key_error: <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</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/error.rs.html#63-69" 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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-4" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `ScriptContextEnum` enum in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptContextEnum"><title>bdk::keys::ScriptContextEnum - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum ScriptContextEnum</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Legacy">Legacy</a><a href="#variant.Segwitv0">Segwitv0</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.is_legacy">is_legacy</a><a href="#method.is_segwit_v0">is_segwit_v0</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-PartialEq%3CScriptContextEnum%3E">PartialEq<ScriptContextEnum></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "ScriptContextEnum", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#131-136" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="enum" href="">ScriptContextEnum</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum ScriptContextEnum {
+ Legacy,
+ Segwitv0,
+}</pre></div><div class="docblock"><p>Enum representation of the known valid <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a>s</p>
+</div><h2 id="variants" class="variants small-section-header">
+ Variants<a href="#variants" class="anchor"></a></h2>
+<div id="variant.Legacy" class="variant small-section-header"><a href="#variant.Legacy" class="anchor field"></a><code>Legacy</code></div><div class="docblock"><p>Legacy scripts</p>
+</div><div id="variant.Segwitv0" class="variant small-section-header"><a href="#variant.Segwitv0" class="anchor field"></a><code>Segwitv0</code></div><div class="docblock"><p>Segwitv0 scripts</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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#138-148" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.is_legacy" class="method"><code>pub fn <a href="#method.is_legacy" class="fnname">is_legacy</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/keys/mod.rs.html#140-142" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whether the script context is <a href="../../bdk/keys/enum.ScriptContextEnum.html#variant.Legacy" title="ScriptContextEnum::Legacy"><code>ScriptContextEnum::Legacy</code></a></p>
+</div><h4 id="method.is_segwit_v0" class="method"><code>pub fn <a href="#method.is_segwit_v0" class="fnname">is_segwit_v0</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/keys/mod.rs.html#145-147" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whether the script context is <a href="../../bdk/keys/enum.ScriptContextEnum.html#variant.Segwitv0" title="ScriptContextEnum::Segwitv0"><code>ScriptContextEnum::Segwitv0</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-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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" 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>pub 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#128-130" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/keys/mod.rs.html#130" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-PartialEq%3CScriptContextEnum%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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a>> for <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-PartialEq%3CScriptContextEnum%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" 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>pub 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#209-211" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#130" 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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `any_network` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, any_network"><title>bdk::keys::any_network - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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">keys</a></p><script>window.sidebarCurrent = {name: "any_network", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#55-59" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="fn" href="">any_network</a></span></h1><pre class="rust fn">pub fn any_network() -> <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a></pre><div class="docblock"><p>Create a set containing mainnet, testnet and regtest</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 `mainnet_network` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, mainnet_network"><title>bdk::keys::mainnet_network - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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">keys</a></p><script>window.sidebarCurrent = {name: "mainnet_network", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#61-63" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="fn" href="">mainnet_network</a></span></h1><pre class="rust fn">pub fn mainnet_network() -> <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a></pre><div class="docblock"><p>Create a set only containing mainnet</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 `merge_networks` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, merge_networks"><title>bdk::keys::merge_networks - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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">keys</a></p><script>window.sidebarCurrent = {name: "merge_networks", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#71-73" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="fn" href="">merge_networks</a></span></h1><pre class="rust fn">pub fn merge_networks(a: &<a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a>, b: &<a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a>) -> <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a></pre><div class="docblock"><p>Compute the intersection of two sets</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 `test_networks` fn in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, test_networks"><title>bdk::keys::test_networks - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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">keys</a></p><script>window.sidebarCurrent = {name: "test_networks", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#65-69" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="fn" href="">test_networks</a></span></h1><pre class="rust fn">pub fn test_networks() -> <a class="type" href="../../bdk/keys/type.ValidNetworks.html" title="type bdk::keys::ValidNetworks">ValidNetworks</a></pre><div class="docblock"><p>Create a set containing testnet and regtest</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 `keys` mod in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, keys"><title>bdk::keys - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module keys</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="#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: "keys", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#25-738" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">bdk</a>::<wbr><a class="mod" href="">keys</a></span></h1><div class="docblock"><p>Key formats</p>
+</div><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
+<table><tr class="module-item"><td><a class="mod" href="bip39/index.html" title="bdk::keys::bip39 mod">bip39</a></td><td class="docblock-short"><span class="stab portability" title="This is supported on crate feature `keys-bip39` only"><code>keys-bip39</code></span><p>BIP-0039</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.DescriptorSinglePriv.html" title="bdk::keys::DescriptorSinglePriv struct">DescriptorSinglePriv</a></td><td class="docblock-short"><p>A Single Descriptor Secret Key with optional origin information</p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.DescriptorSinglePub.html" title="bdk::keys::DescriptorSinglePub struct">DescriptorSinglePub</a></td><td class="docblock-short"><p>A Single Descriptor Key with optional origin information</p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.GeneratedKey.html" title="bdk::keys::GeneratedKey struct">GeneratedKey</a></td><td class="docblock-short"><p>Output of a <a href="../../bdk/keys/trait.GeneratableKey.html" title="GeneratableKey"><code>GeneratableKey</code></a> key generation</p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.PrivateKeyGenerateOptions.html" title="bdk::keys::PrivateKeyGenerateOptions struct">PrivateKeyGenerateOptions</a></td><td class="docblock-short"><p>Options for generating a [<code>PrivateKey</code>]</p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.SortedMultiVec.html" title="bdk::keys::SortedMultiVec struct">SortedMultiVec</a></td><td class="docblock-short"><p>Contents of a "sortedmulti" descriptor</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.DescriptorKey.html" title="bdk::keys::DescriptorKey enum">DescriptorKey</a></td><td class="docblock-short"><p>Container for public or secret keys</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.DescriptorPublicKey.html" title="bdk::keys::DescriptorPublicKey enum">DescriptorPublicKey</a></td><td class="docblock-short"><p>The MiniscriptKey corresponding to Descriptors. This can
+either be Single public key or a Xpub</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.DescriptorSecretKey.html" title="bdk::keys::DescriptorSecretKey enum">DescriptorSecretKey</a></td><td class="docblock-short"><p>A Secret Key that can be either a single key or an Xprv</p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.KeyError.html" title="bdk::keys::KeyError enum">KeyError</a></td><td class="docblock-short"><p>Errors thrown while working with <a href="../../bdk/keys/index.html"><code>keys</code></a></p>
+</td></tr><tr class="module-item"><td><a class="enum" href="enum.ScriptContextEnum.html" title="bdk::keys::ScriptContextEnum enum">ScriptContextEnum</a></td><td class="docblock-short"><p>Enum representation of the known valid <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a>s</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.DerivableKey.html" title="bdk::keys::DerivableKey trait">DerivableKey</a></td><td class="docblock-short"><p>Trait for keys that can be derived.</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.ExtScriptContext.html" title="bdk::keys::ExtScriptContext trait">ExtScriptContext</a></td><td class="docblock-short"><p>Trait that adds extra useful methods to <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a>s</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.GeneratableDefaultOptions.html" title="bdk::keys::GeneratableDefaultOptions trait">GeneratableDefaultOptions</a></td><td class="docblock-short"><p>Trait that allows generating a key with the default options</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.GeneratableKey.html" title="bdk::keys::GeneratableKey trait">GeneratableKey</a></td><td class="docblock-short"><p>Trait for keys that can be generated</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.ScriptContext.html" title="bdk::keys::ScriptContext trait">ScriptContext</a></td><td class="docblock-short"><p>The ScriptContext for Miniscript. Additional type information associated with
+miniscript that is used for carrying out checks that dependent on the
+context under which the script is used.
+For example, disallowing uncompressed keys in Segwit context</p>
+</td></tr><tr class="module-item"><td><a class="trait" href="trait.ToDescriptorKey.html" title="bdk::keys::ToDescriptorKey trait">ToDescriptorKey</a></td><td class="docblock-short"><p>Trait for objects that can be turned into a public or secret <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</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.any_network.html" title="bdk::keys::any_network fn">any_network</a></td><td class="docblock-short"><p>Create a set containing mainnet, testnet and regtest</p>
+</td></tr><tr class="module-item"><td><a class="fn" href="fn.mainnet_network.html" title="bdk::keys::mainnet_network fn">mainnet_network</a></td><td class="docblock-short"><p>Create a set only containing mainnet</p>
+</td></tr><tr class="module-item"><td><a class="fn" href="fn.merge_networks.html" title="bdk::keys::merge_networks fn">merge_networks</a></td><td class="docblock-short"><p>Compute the intersection of two sets</p>
+</td></tr><tr class="module-item"><td><a class="fn" href="fn.test_networks.html" title="bdk::keys::test_networks fn">test_networks</a></td><td class="docblock-short"><p>Create a set containing testnet and regtest</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.ValidNetworks.html" title="bdk::keys::ValidNetworks type">ValidNetworks</a></td><td class="docblock-short"><p>Set of valid networks for a key</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":[["DescriptorKey","Container for public or secret keys"],["DescriptorPublicKey","The MiniscriptKey corresponding to Descriptors. This can either be Single public key or a Xpub"],["DescriptorSecretKey","A Secret Key that can be either a single key or an Xprv"],["KeyError","Errors thrown while working with `keys`"],["ScriptContextEnum","Enum representation of the known valid [`ScriptContext`]s"]],"fn":[["any_network","Create a set containing mainnet, testnet and regtest"],["mainnet_network","Create a set only containing mainnet"],["merge_networks","Compute the intersection of two sets"],["test_networks","Create a set containing testnet and regtest"]],"mod":[["bip39","BIP-0039"]],"struct":[["DescriptorSinglePriv","A Single Descriptor Secret Key with optional origin information"],["DescriptorSinglePub","A Single Descriptor Key with optional origin information"],["GeneratedKey","Output of a [`GeneratableKey`] key generation"],["PrivateKeyGenerateOptions","Options for generating a [`PrivateKey`]"],["SortedMultiVec","Contents of a \"sortedmulti\" descriptor"]],"trait":[["DerivableKey","Trait for keys that can be derived."],["ExtScriptContext","Trait that adds extra useful methods to [`ScriptContext`]s"],["GeneratableDefaultOptions","Trait that allows generating a key with the default options"],["GeneratableKey","Trait for keys that can be generated"],["ScriptContext","The ScriptContext for Miniscript. Additional type information associated with miniscript that is used for carrying out checks that dependent on the context under which the script is used. For example, disallowing uncompressed keys in Segwit context"],["ToDescriptorKey","Trait for objects that can be turned into a public or secret [`DescriptorKey`]"]],"type":[["ValidNetworks","Set of valid networks for a key"]]});
\ 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 `DescriptorSinglePriv` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorSinglePriv"><title>bdk::keys::DescriptorSinglePriv - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct DescriptorSinglePriv</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.key">key</a><a href="#structfield.origin">origin</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "DescriptorSinglePriv", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</a>::<wbr><a class="struct" href="">DescriptorSinglePriv</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct DescriptorSinglePriv {
+ pub origin: <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>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
+ pub key: PrivateKey,
+}</pre></div><div class="docblock"><p>A Single Descriptor Secret Key with optional origin information</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.origin" class="structfield small-section-header"><a href="#structfield.origin" class="anchor field"></a><code>origin: <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>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><div class="docblock"><p>Origin information</p>
+</div><span id="structfield.key" class="structfield small-section-header"><a href="#structfield.key" class="anchor field"></a><code>key: PrivateKey</code></span><div class="docblock"><p>The key</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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-Debug" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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></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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePriv.html" title="struct bdk::keys::DescriptorSinglePriv">DescriptorSinglePriv</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `DescriptorSinglePub` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DescriptorSinglePub"><title>bdk::keys::DescriptorSinglePub - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct DescriptorSinglePub</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.key">key</a><a href="#structfield.origin">origin</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-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CDescriptorSinglePub%3E">PartialEq<DescriptorSinglePub></a><a href="#impl-PartialOrd%3CDescriptorSinglePub%3E">PartialOrd<DescriptorSinglePub></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "DescriptorSinglePub", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</a>::<wbr><a class="struct" href="">DescriptorSinglePub</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct DescriptorSinglePub {
+ pub origin: <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>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
+ pub key: PublicKey,
+}</pre></div><div class="docblock"><p>A Single Descriptor Key with optional origin information</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.origin" class="structfield small-section-header"><a href="#structfield.origin" class="anchor field"></a><code>origin: <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>Fingerprint, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><div class="docblock"><p>Origin information</p>
+</div><span id="structfield.key" class="structfield small-section-header"><a href="#structfield.key" class="anchor field"></a><code>key: PublicKey</code></span><div class="docblock"><p>The key</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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Clone" class="anchor"></a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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>pub 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#128-130" 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Debug" class="anchor"></a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Eq" class="anchor"></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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Hash" class="anchor"></a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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 <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Ord" class="anchor"></a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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%3CDescriptorSinglePub%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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a>> for <a class="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-PartialEq%3CDescriptorSinglePub%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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>!=</code>.</p>
+</div></div><h3 id="impl-PartialOrd%3CDescriptorSinglePub%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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a>> for <a class="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-PartialOrd%3CDescriptorSinglePub%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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 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>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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 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>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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 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>pub 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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 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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</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="struct" href="../../bdk/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.DescriptorSinglePub.html" title="struct bdk::keys::DescriptorSinglePub">DescriptorSinglePub</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `GeneratedKey` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, GeneratedKey"><title>bdk::keys::GeneratedKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct GeneratedKey</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.into_key">into_key</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Deref">Deref</a><a href="#impl-DerivableKey%3CCtx%3E">DerivableKey<Ctx></a><a href="#impl-ToDescriptorKey%3CCtx%3E">ToDescriptorKey<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-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "GeneratedKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#354-358" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="struct" href="">GeneratedKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct GeneratedKey<K, Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> { /* fields omitted */ }</pre></div><div class="docblock"><p>Output of a <a href="../../bdk/keys/trait.GeneratableKey.html" title="GeneratableKey"><code>GeneratableKey</code></a> key generation</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<K, Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#360-373" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into_key" class="method"><code>pub fn <a href="#method.into_key" class="fnname">into_key</a>(self) -> K</code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#370-372" title="goto source code">[src]</a></h4><div class="docblock"><p>Consumes <code>self</code> and returns the key</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-Deref" class="impl"><code class="in-band">impl<K, Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#375-381" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = K</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
+</div><h4 id="method.deref" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#378-380" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
+</div></div><h3 id="impl-DerivableKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx, K> <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> K: <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx>, </span></code><a href="#impl-DerivableKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#385-398" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_metadata" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.DerivableKey.html#tymethod.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#390-397" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Add a extra metadata, consume <code>self</code> and turn it into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a></p>
+</div></div><h3 id="impl-ToDescriptorKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx, K> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> K: <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx>, </span></code><a href="#impl-ToDescriptorKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#402-411" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key" class="method hidden"><code>pub fn <a href="../../bdk/keys/trait.ToDescriptorKey.html#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#407-410" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn the key into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a> within the requested <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></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<K, 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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, 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> K: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<K, 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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, 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>,<br> K: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<K, 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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> K: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<K, 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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, 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> K: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<K, 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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> K: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref-1" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `PrivateKeyGenerateOptions` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, PrivateKeyGenerateOptions"><title>bdk::keys::PrivateKeyGenerateOptions - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct PrivateKeyGenerateOptions</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.compressed">compressed</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></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "PrivateKeyGenerateOptions", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#497-500" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="struct" href="">PrivateKeyGenerateOptions</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PrivateKeyGenerateOptions {
+ pub compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
+}</pre></div><div class="docblock"><p>Options for generating a [<code>PrivateKey</code>]</p>
+<p>Defaults to creating compressed keys, which save on-chain bytes and fees</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.compressed" class="structfield small-section-header"><a href="#structfield.compressed" class="anchor field"></a><code>compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><div class="docblock"><p>Whether the generated key should be "compressed" or not</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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#496" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#496" 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>pub 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#128-130" 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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#496" 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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#496" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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/keys/mod.rs.html#496" 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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#502-506" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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/keys/mod.rs.html#503-505" 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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `SortedMultiVec` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, SortedMultiVec"><title>bdk::keys::SortedMultiVec - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct SortedMultiVec</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.k">k</a><a href="#structfield.pks">pks</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.encode">encode</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.new">new</a><a href="#method.satisfy">satisfy</a><a href="#method.script_size">script_size</a><a href="#method.sorted_node">sorted_node</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-Liftable%3CPk%3E">Liftable<Pk></a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CSortedMultiVec%3CPk%2C%20Ctx%3E%3E">PartialEq<SortedMultiVec<Pk, Ctx>></a><a href="#impl-PartialOrd%3CSortedMultiVec%3CPk%2C%20Ctx%3E%3E">PartialOrd<SortedMultiVec<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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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">keys</a></p><script>window.sidebarCurrent = {name: "SortedMultiVec", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</a>::<wbr><a class="struct" href="">SortedMultiVec</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct SortedMultiVec<Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a>, </span> {
+ pub k: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
+ pub pks: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>,
+ // some fields omitted
+}</pre></div><div class="docblock"><p>Contents of a "sortedmulti" descriptor</p>
+</div><h2 id="fields" class="fields small-section-header">
+ Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.k" class="structfield small-section-header"><a href="#structfield.k" class="anchor field"></a><code>k: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><div class="docblock"><p>signatures required</p>
+</div><span id="structfield.pks" class="structfield small-section-header"><a href="#structfield.pks" class="anchor field"></a><code>pks: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>></code></span><div class="docblock"><p>public keys inside sorted Multi</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(<br> k: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> pks: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><Pk, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx>, Error></code></h4><div class="docblock"><p>Create a new instance of <code>SortedMultiVec</code> given a list of keys and the threshold</p>
+<p>Internally checks all the applicable size limits and pubkey types limitations according to the current <code>Ctx</code>.</p>
+</div></div><h3 id="impl-1" class="impl"><code class="in-band">impl<Pk, Ctx> <a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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.translate_pk" class="method"><code>pub fn <a href="#method.translate_pk" class="fnname">translate_pk</a><FPk, Q, FuncError>(<br> &self, <br> translatefpk: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>FPk<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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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> 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-2" class="impl"><code class="in-band">impl<Pk, Ctx> <a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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-2" class="anchor"></a></h3><div class="impl-items"><h4 id="method.sorted_node" class="method"><code>pub fn <a href="#method.sorted_node" class="fnname">sorted_node</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> <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="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Create Terminal::Multi containing sorted pubkeys</p>
+</div><h4 id="method.encode" class="method"><code>pub fn <a href="#method.encode" class="fnname">encode</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> Script <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Encode as a Bitcoin script</p>
+</div><h4 id="method.satisfy" class="method"><code>pub fn <a href="#method.satisfy" class="fnname">satisfy</a><ToPkCtx, S>(<br> &self, <br> satisfier: S, <br> to_pk_ctx: ToPkCtx<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="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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, Error> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> S: Satisfier<ToPkCtx, Pk>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></code></h4><div class="docblock"><p>Attempt to produce a satisfying witness for the
+witness script represented by the parse tree</p>
+</div><h4 id="method.script_size" class="method"><code>pub fn <a href="#method.script_size" class="fnname">script_size</a><ToPkCtx>(&self, to_pk_ctx: ToPkCtx) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.ToPublicKey.html" title="trait bdk::descriptor::ToPublicKey">ToPublicKey</a><ToPkCtx>,<br> ToPkCtx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, </span></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 malformed <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, <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 malformed <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="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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#128-130" 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>, </span></code><a href="#impl-Eq" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Liftable%3CPk%3E" class="impl"><code class="in-band">impl<Pk, Ctx> Liftable<Pk> for <a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>pub fn <a href="#method.lift" class="fnname">lift</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Policy<Pk>, Error></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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>, </span></code><a href="#impl-Ord" class="anchor"></a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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 <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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%3CSortedMultiVec%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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx>> for <a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>, </span></code><a href="#impl-PartialEq%3CSortedMultiVec%3CPk%2C%20Ctx%3E%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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%3CSortedMultiVec%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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx>> for <a class="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>, </span></code><a href="#impl-PartialOrd%3CSortedMultiVec%3CPk%2C%20Ctx%3E%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>pub 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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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="struct" href="../../bdk/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>, </span></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>,<br> Pk: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <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.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</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>, </span></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/keys/struct.SortedMultiVec.html" title="struct bdk::keys::SortedMultiVec">SortedMultiVec</a><Pk, Ctx> <span class="where fmt-newline">where<br> Ctx: <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.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `DerivableKey` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, DerivableKey"><title>bdk::keys::DerivableKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait DerivableKey</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.add_metadata">add_metadata</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-DerivableKey%3CCtx%3E-for-ExtendedPrivKey">ExtendedPrivKey</a><a href="#impl-DerivableKey%3CCtx%3E-for-ExtendedPubKey">ExtendedPubKey</a><a href="#impl-DerivableKey%3CCtx%3E-for-Mnemonic">Mnemonic</a><a href="#impl-DerivableKey%3CCtx%3E-for-Seed">Seed</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">keys</a></p><script>window.sidebarCurrent = {name: "DerivableKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#312-319" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="trait" href="">DerivableKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait DerivableKey<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> {
+ pub fn <a href="#tymethod.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>>;
+}</pre></div><div class="docblock"><p>Trait for keys that can be derived.</p>
+<p>When extra metadata are provided, a <a href="../../bdk/keys/trait.DerivableKey.html" title="DerivableKey"><code>DerivableKey</code></a> can be transofrmed into a
+<a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a>: the trait <a href="../../bdk/keys/trait.ToDescriptorKey.html" title="ToDescriptorKey"><code>ToDescriptorKey</code></a> is automatically implemented
+for <code>(DerivableKey, DerivationPath)</code> and
+<code>(DerivableKey, KeySource, DerivationPath)</code> tuples.</p>
+<p>For key types that don't encode any indication about the path to use (like bip39), it's
+generally recommended to implemented this trait instead of <a href="../../bdk/keys/trait.ToDescriptorKey.html" title="ToDescriptorKey"><code>ToDescriptorKey</code></a>. The same
+rules regarding script context and valid networks apply.</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.add_metadata" class="method"><code>pub fn <a href="#tymethod.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#314-318" title="goto source code">[src]</a></h3><div class="docblock"><p>Add a extra metadata, consume <code>self</code> and turn it into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</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-DerivableKey%3CCtx%3E-for-Seed" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for Seed</code><a href="#impl-DerivableKey%3CCtx%3E-for-Seed" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#43-57" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="impl-items"><h4 id="method.add_metadata" class="method hidden"><code>pub fn <a href="#method.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#44-56" title="goto source code">[src]</a></h4></div><h3 id="impl-DerivableKey%3CCtx%3E-for-Mnemonic" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for Mnemonic</code><a href="#impl-DerivableKey%3CCtx%3E-for-Mnemonic" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#73-81" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="impl-items"><h4 id="method.add_metadata-1" class="method hidden"><code>pub fn <a href="#method.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#74-80" title="goto source code">[src]</a></h4></div><h3 id="impl-DerivableKey%3CCtx%3E-for-ExtendedPubKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for ExtendedPubKey</code><a href="#impl-DerivableKey%3CCtx%3E-for-ExtendedPubKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#321-335" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_metadata-2" class="method hidden"><code>pub fn <a href="#method.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#322-334" title="goto source code">[src]</a></h4></div><h3 id="impl-DerivableKey%3CCtx%3E-for-ExtendedPrivKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx> for ExtendedPrivKey</code><a href="#impl-DerivableKey%3CCtx%3E-for-ExtendedPrivKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#337-351" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_metadata-3" class="method hidden"><code>pub fn <a href="#method.add_metadata" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#338-350" 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-DerivableKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx, K> DerivableKey<Ctx> for <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> K: <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx>, </span></code><a href="#impl-DerivableKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#385-398" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_metadata-4" class="method hidden"><code>pub fn <a href="#method.add_metadata-4" class="fnname">add_metadata</a>(<br> self, <br> origin: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#390-397" title="goto source code">[src]</a></h4></div><h3 id="impl-DerivableKey%3CCtx%3E-1" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> DerivableKey<Ctx> for <a class="type" href="../../bdk/keys/bip39/type.MnemonicWithPassphrase.html" title="type bdk::keys::bip39::MnemonicWithPassphrase">MnemonicWithPassphrase</a></code><a href="#impl-DerivableKey%3CCtx%3E-1" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#60-70" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="impl-items"><h4 id="method.add_metadata-5" class="method hidden"><code>pub fn <a href="#method.add_metadata-5" class="fnname">add_metadata</a>(<br> self, <br> source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><KeySource>, <br> derivation_path: DerivationPath<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/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#61-69" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/bdk/keys/trait.DerivableKey.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 `ExtScriptContext` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ExtScriptContext"><title>bdk::keys::ExtScriptContext - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait ExtScriptContext</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.as_enum">as_enum</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.is_legacy">is_legacy</a><a href="#method.is_segwit_v0">is_segwit_v0</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">keys</a></p><script>window.sidebarCurrent = {name: "ExtScriptContext", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#151-164" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="trait" href="">ExtScriptContext</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait ExtScriptContext: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a> {
+ pub fn <a href="#tymethod.as_enum" class="fnname">as_enum</a>() -> <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a>;
+
+ pub fn <a href="#method.is_legacy" class="fnname">is_legacy</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
+<div class="item-spacer"></div> pub fn <a href="#method.is_segwit_v0" class="fnname">is_segwit_v0</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
+}</pre></div><div class="docblock"><p>Trait that adds extra useful methods to <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a>s</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.as_enum" class="method"><code>pub fn <a href="#tymethod.as_enum" class="fnname">as_enum</a>() -> <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#153" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a> as a <a href="../../bdk/keys/enum.ScriptContextEnum.html" title="ScriptContextEnum"><code>ScriptContextEnum</code></a></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_legacy" class="method"><code>pub fn <a href="#method.is_legacy" class="fnname">is_legacy</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#156-158" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Legacy.html"><code>Legacy</code></a></p>
+</div><h3 id="method.is_segwit_v0" class="method"><code>pub fn <a href="#method.is_segwit_v0" class="fnname">is_segwit_v0</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#161-163" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns whether the script context is <a href="../../bdk/descriptor/enum.Segwitv0.html"><code>Segwitv0</code></a></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-ExtScriptContext" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a> + 'static> ExtScriptContext for Ctx</code><a href="#impl-ExtScriptContext" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#166-174" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.as_enum" class="method hidden"><code>pub fn <a href="#method.as_enum" class="fnname">as_enum</a>() -> <a class="enum" href="../../bdk/keys/enum.ScriptContextEnum.html" title="enum bdk::keys::ScriptContextEnum">ScriptContextEnum</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#167-173" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/bdk/keys/trait.ExtScriptContext.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 `GeneratableDefaultOptions` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, GeneratableDefaultOptions"><title>bdk::keys::GeneratableDefaultOptions - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait GeneratableDefaultOptions</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.generate_default">generate_default</a><a href="#method.generate_with_entropy_default">generate_with_entropy_default</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">keys</a></p><script>window.sidebarCurrent = {name: "GeneratableDefaultOptions", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#449-465" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="trait" href="">GeneratableDefaultOptions</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait GeneratableDefaultOptions<Ctx>: <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, </span>{
+ pub fn <a href="#method.generate_with_entropy_default" class="fnname">generate_with_entropy_default</a>(<br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>> { ... }
+<div class="item-spacer"></div> pub fn <a href="#method.generate_default" class="fnname">generate_default</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>> { ... }
+}</pre></div><div class="docblock"><p>Trait that allows generating a key with the default options</p>
+<p>This trait is automatically implemented if the <a href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="GeneratableKey::Options"><code>GeneratableKey::Options</code></a> implements <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="Default"><code>Default</code></a>.</p>
+</div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.generate_with_entropy_default" class="method"><code>pub fn <a href="#method.generate_with_entropy_default" class="fnname">generate_with_entropy_default</a>(<br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#455-459" title="goto source code">[src]</a></h3><div class="docblock"><p>Generate a key with the default options and a given entropy</p>
+</div><h3 id="method.generate_default" class="method"><code>pub fn <a href="#method.generate_default" class="fnname">generate_default</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#462-464" title="goto source code">[src]</a></h3><div class="docblock"><p>Generate a key with the default options and a random entropy</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-GeneratableDefaultOptions%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx, K> GeneratableDefaultOptions<Ctx> for K <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> K: <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx>,<br> <K as <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx>>::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, </span></code><a href="#impl-GeneratableDefaultOptions%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#469-475" title="goto source code">[src]</a></h3><div class="docblock"><p>Automatic implementation of <a href="../../bdk/keys/trait.GeneratableDefaultOptions.html" title="GeneratableDefaultOptions"><code>GeneratableDefaultOptions</code></a> for <a href="../../bdk/keys/trait.GeneratableKey.html" title="GeneratableKey"><code>GeneratableKey</code></a>s where
+<code>Options</code> implements <code>Default</code></p>
+</div><div class="impl-items"></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/bdk/keys/trait.GeneratableDefaultOptions.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 `GeneratableKey` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, GeneratableKey"><title>bdk::keys::GeneratableKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait GeneratableKey</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.Entropy">Entropy</a><a href="#associatedtype.Error">Error</a><a href="#associatedtype.Options">Options</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.generate_with_entropy">generate_with_entropy</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.generate">generate</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-GeneratableKey%3CCtx%3E-for-ExtendedPrivKey">ExtendedPrivKey</a><a href="#impl-GeneratableKey%3CCtx%3E-for-Mnemonic">Mnemonic</a><a href="#impl-GeneratableKey%3CCtx%3E-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">keys</a></p><script>window.sidebarCurrent = {name: "GeneratableKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#421-444" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="trait" href="">GeneratableKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait GeneratableKey<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
+ type <a href="#associatedtype.Entropy" class="type">Entropy</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</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>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>;
+ type <a href="#associatedtype.Options" class="type">Options</a>;
+ type <a href="#associatedtype.Error" class="type">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
+ pub fn <a href="#tymethod.generate_with_entropy" class="fnname">generate_with_entropy</a>(<br> options: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>, <br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>>;
+
+ pub fn <a href="#method.generate" class="fnname">generate</a>(<br> options: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>> { ... }
+}</pre></div><div class="docblock"><p>Trait for keys that can be generated</p>
+<p>The same rules about <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</code></a> and <a href="../../bdk/keys/type.ValidNetworks.html" title="ValidNetworks"><code>ValidNetworks</code></a> from <a href="../../bdk/keys/trait.ToDescriptorKey.html" title="ToDescriptorKey"><code>ToDescriptorKey</code></a> apply.</p>
+<p>This trait is particularly useful when combined with <a href="../../bdk/keys/trait.DerivableKey.html" title="DerivableKey"><code>DerivableKey</code></a>: if <code>Self</code>
+implements it, the returned <a href="../../bdk/keys/struct.GeneratedKey.html" title="GeneratedKey"><code>GeneratedKey</code></a> will also implement it. The same is true for
+<a href="../../bdk/keys/trait.ToDescriptorKey.html" title="ToDescriptorKey"><code>ToDescriptorKey</code></a>: the generated keys can be directly used in descriptors if <code>Self</code> is also
+<a href="../../bdk/keys/trait.ToDescriptorKey.html" title="ToDescriptorKey"><code>ToDescriptorKey</code></a>.</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.Entropy" class="method"><code>type <a href="#associatedtype.Entropy" class="type">Entropy</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</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>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#423" title="goto source code">[src]</a></h3><div class="docblock"><p>Type specifying the amount of entropy required e.g. [u8;32]</p>
+</div><h3 id="associatedtype.Options" class="method"><code>type <a href="#associatedtype.Options" class="type">Options</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#426" title="goto source code">[src]</a></h3><div class="docblock"><p>Extra options required by the <code>generate_with_entropy</code></p>
+</div><h3 id="associatedtype.Error" class="method"><code>type <a href="#associatedtype.Error" class="type">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#428" title="goto source code">[src]</a></h3><div class="docblock"><p>Returned error in case of failure</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.generate_with_entropy" class="method"><code>pub fn <a href="#tymethod.generate_with_entropy" class="fnname">generate_with_entropy</a>(<br> options: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>, <br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#431-434" title="goto source code">[src]</a></h3><div class="docblock"><p>Generate a key given the extra options and the entropy</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.generate" class="method"><code>pub fn <a href="#method.generate" class="fnname">generate</a>(<br> options: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#437-443" title="goto source code">[src]</a></h3><div class="docblock"><p>Generate a key given the options with a random entropy</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-GeneratableKey%3CCtx%3E-for-Mnemonic" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx> for Mnemonic</code><a href="#impl-GeneratableKey%3CCtx%3E-for-Mnemonic" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#84-99" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab portability">This is supported on <strong>crate feature <code>keys-bip39</code></strong> only.</div></div><div class="impl-items"><h4 id="associatedtype.Entropy-1" class="type"><code>type <a href="#associatedtype.Entropy" class="type">Entropy</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.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.array.html">; 32]</a></code></h4><h4 id="associatedtype.Options-1" class="type"><code>type <a href="#associatedtype.Options" class="type">Options</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>MnemonicType, Language<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></h4><h4 id="associatedtype.Error-1" class="type"><code>type <a href="#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><ErrorKind></code></h4><h4 id="method.generate_with_entropy" class="method hidden"><code>pub fn <a href="#method.generate_with_entropy" class="fnname">generate_with_entropy</a>(<br> (mnemonic_type, language): Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>, <br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/bip39.rs.html#90-98" title="goto source code">[src]</a></h4></div><h3 id="impl-GeneratableKey%3CCtx%3E-for-ExtendedPrivKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx> for ExtendedPrivKey</code><a href="#impl-GeneratableKey%3CCtx%3E-for-ExtendedPrivKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#477-491" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Entropy-2" class="type"><code>type <a href="#associatedtype.Entropy" class="type">Entropy</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.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.array.html">; 32]</a></code></h4><h4 id="associatedtype.Options-2" class="type"><code>type <a href="#associatedtype.Options" class="type">Options</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><h4 id="associatedtype.Error-2" class="type"><code>type <a href="#associatedtype.Error" class="type">Error</a> = Error</code></h4><h4 id="method.generate_with_entropy-1" class="method hidden"><code>pub fn <a href="#method.generate_with_entropy" class="fnname">generate_with_entropy</a>(<br> _: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>, <br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#483-490" title="goto source code">[src]</a></h4></div><h3 id="impl-GeneratableKey%3CCtx%3E-for-PrivateKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.GeneratableKey.html" title="trait bdk::keys::GeneratableKey">GeneratableKey</a><Ctx> for PrivateKey</code><a href="#impl-GeneratableKey%3CCtx%3E-for-PrivateKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#508-528" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Entropy-3" class="type"><code>type <a href="#associatedtype.Entropy" class="type">Entropy</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.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.array.html">; 32]</a></code></h4><h4 id="associatedtype.Options-3" class="type"><code>type <a href="#associatedtype.Options" class="type">Options</a> = <a class="struct" href="../../bdk/keys/struct.PrivateKeyGenerateOptions.html" title="struct bdk::keys::PrivateKeyGenerateOptions">PrivateKeyGenerateOptions</a></code></h4><h4 id="associatedtype.Error-3" class="type"><code>type <a href="#associatedtype.Error" class="type">Error</a> = Error</code></h4><h4 id="method.generate_with_entropy-2" class="method hidden"><code>pub fn <a href="#method.generate_with_entropy" class="fnname">generate_with_entropy</a>(<br> options: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Options" title="type bdk::keys::GeneratableKey::Options">Options</a>, <br> entropy: Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Entropy" title="type bdk::keys::GeneratableKey::Entropy">Entropy</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/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><Self, Ctx>, Self::<a class="type" href="../../bdk/keys/trait.GeneratableKey.html#associatedtype.Error" title="type bdk::keys::GeneratableKey::Error">Error</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#514-527" 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/keys/trait.GeneratableKey.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::keys::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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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_terminal_non_malleable">check_terminal_non_malleable</a><a href="#tymethod.max_satisfaction_size">max_satisfaction_size</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.check_global_consensus_validity">check_global_consensus_validity</a><a href="#method.check_global_policy_validity">check_global_policy_validity</a><a href="#method.check_global_validity">check_global_validity</a><a href="#method.check_local_consensus_validity">check_local_consensus_validity</a><a href="#method.check_local_policy_validity">check_local_policy_validity</a><a href="#method.check_local_validity">check_local_validity</a><a href="#method.check_witness">check_witness</a><a href="#method.other_top_level_checks">other_top_level_checks</a><a href="#method.top_level_checks">top_level_checks</a><a href="#method.top_level_type_check">top_level_type_check</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ScriptContext-for-Bare">Bare</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">keys</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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keys</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> {
+ pub fn <a href="#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</a><Pk, Ctx><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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>;
+
+ pub fn <a href="#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> _witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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> pub fn <a href="#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error><br> <span class="where">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> Pk: <a class="trait" href="../../bdk/descriptor/trait.MiniscriptKey.html" title="trait bdk::descriptor::MiniscriptKey">MiniscriptKey</a></span>,
+ { ... }
+}</pre></div><div class="docblock"><p>The ScriptContext for Miniscript. Additional type information associated with
+miniscript that is used for carrying out checks that dependent on the
+context under which the script is used.
+For example, disallowing uncompressed keys in Segwit context</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_terminal_non_malleable" class="method"><code>pub fn <a href="#tymethod.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size" class="method"><code>pub fn <a href="#tymethod.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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, the size of a satifaction witness may slightly differ.</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.check_witness" class="method"><code>pub fn <a href="#method.check_witness" class="fnname">check_witness</a><Pk, Ctx>(<br> _witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the given satisfaction is valid under the ScriptContext
+For example, segwit satisfactions may fail if the witness len is more
+3600 or number of stack elements are more than 100.</p>
+</div><h3 id="method.check_global_consensus_validity" class="method"><code>pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 under the current consensus rules.
+Or some of the script resource limits may have been exceeded.
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+uncompressed public keys are non-standard and thus invalid.
+In LegacyP2SH context, scripts above 520 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments.</p>
+</div><h3 id="method.check_global_policy_validity" class="method"><code>pub fn <a href="#method.check_global_policy_validity" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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 script resource limits
+may have been exceeded under the current bitcoin core policy rules
+These miniscripts would never be accepted by the Bitcoin network and hence
+it is safe to discard them. (unless explicitly disabled by non-standard flag)
+For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey
+scripts over 3600 bytes are invalid.
+Post Tapscript upgrade, this would have to consider other nodes.
+This does <em>NOT</em> recursively check the miniscript fragments.</p>
+</div><h3 id="method.check_local_consensus_validity" class="method"><code>pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Consensus rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path(Legacy/Segwitv0) may require more than 201 opcodes.</p>
+</div><h3 id="method.check_local_policy_validity" class="method"><code>pub fn <a href="#method.check_local_policy_validity" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Policy rules at the Miniscript satisfaction time.
+It is possible that some paths of miniscript may exceed resource limits
+and our current satisfier and lifting analysis would not work correctly.
+For example, satisfaction path in Legacy context scriptSig more
+than 1650 bytes</p>
+</div><h3 id="method.check_global_validity" class="method"><code>pub fn <a href="#method.check_global_validity" class="fnname">check_global_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules that are not based
+satisfaction</p>
+</div><h3 id="method.check_local_validity" class="method"><code>pub fn <a href="#method.check_local_validity" class="fnname">check_local_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check the consensus + policy(if not disabled) rules including the
+ones for satisfaction</p>
+</div><h3 id="method.top_level_type_check" class="method"><code>pub fn <a href="#method.top_level_type_check" class="fnname">top_level_type_check</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check whether the top-level is type B</p>
+</div><h3 id="method.other_top_level_checks" class="method"><code>pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> _ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Other top level checks that are context specific</p>
+</div><h3 id="method.top_level_checks" class="method"><code>pub fn <a href="#method.top_level_checks" class="fnname">top_level_checks</a><Pk, Ctx>(ms: &<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/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> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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>Check top level consensus rules.</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-ScriptContext-for-Bare" class="impl"><code class="in-band">impl <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a> for Bare</code><a href="#impl-ScriptContext-for-Bare" class="anchor"></a></h3><div class="impl-items"><h4 id="method.check_terminal_non_malleable" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-1" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-1" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.other_top_level_checks-1" class="method hidden"><code>pub fn <a href="#method.other_top_level_checks" class="fnname">other_top_level_checks</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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>, Error> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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><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_terminal_non_malleable-1" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable-1" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_witness-1" class="method hidden"><code>pub fn <a href="#method.check_witness-1" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-2" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity-2" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-2" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity-2" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_policy_validity-1" class="method hidden"><code>pub fn <a href="#method.check_local_policy_validity-1" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size-1" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size-1" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_terminal_non_malleable-2" class="method hidden"><code>pub fn <a href="#method.check_terminal_non_malleable-2" class="fnname">check_terminal_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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_witness-2" class="method hidden"><code>pub fn <a href="#method.check_witness-2" class="fnname">check_witness</a><Pk, Ctx>(<br> witness: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</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>, ScriptContextError> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_consensus_validity-3" class="method hidden"><code>pub fn <a href="#method.check_global_consensus_validity-3" class="fnname">check_global_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_consensus_validity-3" class="method hidden"><code>pub fn <a href="#method.check_local_consensus_validity-3" class="fnname">check_local_consensus_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_global_policy_validity-1" class="method hidden"><code>pub fn <a href="#method.check_global_policy_validity-1" class="fnname">check_global_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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_local_policy_validity-2" class="method hidden"><code>pub fn <a href="#method.check_local_policy_validity-2" class="fnname">check_local_policy_validity</a><Pk, Ctx>(<br> ms: &<a class="struct" href="../../bdk/descriptor/struct.Miniscript.html" title="struct bdk::descriptor::Miniscript">Miniscript</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/keys/trait.ScriptContext.html" title="trait bdk::keys::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.max_satisfaction_size-2" class="method hidden"><code>pub fn <a href="#method.max_satisfaction_size-2" class="fnname">max_satisfaction_size</a><Pk, Ctx>(ms: &<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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::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 `ToDescriptorKey` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ToDescriptorKey"><title>bdk::keys::ToDescriptorKey - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait ToDescriptorKey</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.to_descriptor_key">to_descriptor_key</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)">(T, DerivationPath)</a><a href="#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)">(T, KeySource, DerivationPath)</a><a href="#impl-ToDescriptorKey%3CCtx%3E-for-PrivateKey">PrivateKey</a><a href="#impl-ToDescriptorKey%3CCtx%3E-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">keys</a></p><script>window.sidebarCurrent = {name: "ToDescriptorKey", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#295-298" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="trait" href="">ToDescriptorKey</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait ToDescriptorKey<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
+ pub fn <a href="#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>>;
+}</pre></div><div class="docblock"><p>Trait for objects that can be turned into a public or secret <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a></p>
+<p>The generic type <code>Ctx</code> is used to define the context in which the key is valid: some key
+formats, like the mnemonics used by Electrum wallets, encode internally whether the wallet is
+legacy or segwit. Thus, trying to turn a valid legacy mnemonic into a <code>DescriptorKey</code>
+that would become part of a segwit descriptor should fail.</p>
+<p>For key types that do care about this, the <a href="../../bdk/keys/trait.ExtScriptContext.html" title="ExtScriptContext"><code>ExtScriptContext</code></a> trait provides some useful
+methods that can be used to check at runtime which <code>Ctx</code> is being used.</p>
+<p>For key types that can do this check statically (because they can only work within a
+single <code>Ctx</code>), the "specialized" trait can be implemented to make the compiler handle the type
+checking.</p>
+<p>Keys also have control over the networks they support: constructing the return object with
+<a href="../../bdk/keys/enum.DescriptorKey.html#method.from_public" title="DescriptorKey::from_public"><code>DescriptorKey::from_public</code></a> or <a href="../../bdk/keys/enum.DescriptorKey.html#method.from_secret" title="DescriptorKey::from_secret"><code>DescriptorKey::from_secret</code></a> allows to specify a set of
+<a href="../../bdk/keys/type.ValidNetworks.html" title="ValidNetworks"><code>ValidNetworks</code></a>.</p>
+<h2 id="examples" class="section-header"><a href="#examples">Examples</a></h2>
+<p>Key type valid in any context:</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>;
+
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">KeyError</span>, <span class="ident">ScriptContext</span>, <span class="ident">ToDescriptorKey</span>};
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MyKeyType</span> {
+ <span class="ident">pubkey</span>: <span class="ident">PublicKey</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MyKeyType</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">pubkey</span>.<span class="ident">to_descriptor_key</span>()
+ }
+}</pre></div>
+<p>Key type that is only valid on mainnet:</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>;
+
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">keys</span>::{
+ <span class="ident">mainnet_network</span>, <span class="ident">DescriptorKey</span>, <span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorSinglePub</span>, <span class="ident">KeyError</span>,
+ <span class="ident">ScriptContext</span>, <span class="ident">ToDescriptorKey</span>,
+};
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MyKeyType</span> {
+ <span class="ident">pubkey</span>: <span class="ident">PublicKey</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MyKeyType</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">DescriptorKey</span>::<span class="ident">from_public</span>(
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">SinglePub</span>(<span class="ident">DescriptorSinglePub</span> {
+ <span class="ident">origin</span>: <span class="prelude-val">None</span>,
+ <span class="ident">key</span>: <span class="self">self</span>.<span class="ident">pubkey</span>,
+ }),
+ <span class="ident">mainnet_network</span>(),
+ ))
+ }
+}</pre></div>
+<p>Key type that internally encodes in which context it's valid. The context is checked at runtime:</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>;
+
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">ExtScriptContext</span>, <span class="ident">KeyError</span>, <span class="ident">ScriptContext</span>, <span class="ident">ToDescriptorKey</span>};
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MyKeyType</span> {
+ <span class="ident">is_legacy</span>: <span class="ident">bool</span>,
+ <span class="ident">pubkey</span>: <span class="ident">PublicKey</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="lifetime">'static</span><span class="op">></span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MyKeyType</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">Ctx</span>::<span class="ident">is_legacy</span>() <span class="op">=</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">is_legacy</span> {
+ <span class="self">self</span>.<span class="ident">pubkey</span>.<span class="ident">to_descriptor_key</span>()
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidScriptContext</span>)
+ }
+ }
+}</pre></div>
+<p>Key type that can only work within <a href="../../bdk/descriptor/enum.Segwitv0.html" title="miniscript::Segwitv0"><code>miniscript::Segwitv0</code></a> context. Only the specialized version
+of the trait is implemented.</p>
+<p>This example deliberately fails to compile, to demonstrate how the compiler can catch when keys
+are misused. In this case, the "segwit-only" key is used to build a <code>pkh()</code> descriptor, which
+makes the compiler (correctly) fail.</p>
+
+<div class='information'><div class='tooltip compile_fail'>ⓘ<span class='tooltiptext'>This example deliberately fails to compile</span></div></div><div class="example-wrap"><pre class="rust rust-example-rendered compile_fail">
+<span class="kw">use</span> <span class="ident">bdk</span>::<span class="ident">bitcoin</span>::<span class="ident">PublicKey</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">bdk</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">KeyError</span>, <span class="ident">ToDescriptorKey</span>};
+
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MySegwitOnlyKeyType</span> {
+ <span class="ident">pubkey</span>: <span class="ident">PublicKey</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">bdk</span>::<span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MySegwitOnlyKeyType</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">bdk</span>::<span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">pubkey</span>.<span class="ident">to_descriptor_key</span>()
+ }
+}
+
+<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">MySegwitOnlyKeyType</span> {
+ <span class="ident">pubkey</span>: <span class="ident">PublicKey</span>::<span class="ident">from_str</span>(<span class="string">"..."</span>)<span class="question-mark">?</span>,
+};
+<span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="ident">key</span>))<span class="question-mark">?</span>;
+<span class="comment">// ^^^^^ changing this to `wpkh` would make it compile</span>
+</pre></div>
+</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_descriptor_key" class="method"><code>pub fn <a href="#tymethod.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#297" title="goto source code">[src]</a></h3><div class="docblock"><p>Turn the key into a <a href="../../bdk/keys/enum.DescriptorKey.html" title="DescriptorKey"><code>DescriptorKey</code></a> within the requested <a href="../../bdk/keys/trait.ScriptContext.html" title="ScriptContext"><code>ScriptContext</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-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>, T: <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>T, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#530-534" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#531-533" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>, T: <a class="trait" href="../../bdk/keys/trait.DerivableKey.html" title="trait bdk::keys::DerivableKey">DerivableKey</a><Ctx>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>T, KeySource, DerivationPath<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#536-542" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-1" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#539-541" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-for-PublicKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for PublicKey</code><a href="#impl-ToDescriptorKey%3CCtx%3E-for-PublicKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#642-650" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-2" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#643-649" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-for-PrivateKey" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx> for PrivateKey</code><a href="#impl-ToDescriptorKey%3CCtx%3E-for-PrivateKey" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#670-678" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-3" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#671-677" 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-ToDescriptorKey%3CCtx%3E" class="impl"><code class="in-band">impl<Ctx, K> ToDescriptorKey<Ctx> for <a class="struct" href="../../bdk/keys/struct.GeneratedKey.html" title="struct bdk::keys::GeneratedKey">GeneratedKey</a><K, Ctx> <span class="where fmt-newline">where<br> Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>,<br> K: <a class="trait" href="../../bdk/keys/trait.ToDescriptorKey.html" title="trait bdk::keys::ToDescriptorKey">ToDescriptorKey</a><Ctx>, </span></code><a href="#impl-ToDescriptorKey%3CCtx%3E" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#402-411" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-4" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key-4" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#407-410" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-1" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> ToDescriptorKey<Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx></code><a href="#impl-ToDescriptorKey%3CCtx%3E-1" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#620-624" title="goto source code">[src]</a></h3><div class="docblock"><p>The "identity" conversion is used internally by some <code>bdk::fragment</code>s</p>
+</div><div class="impl-items"><h4 id="method.to_descriptor_key-5" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key-5" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#621-623" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-2" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> ToDescriptorKey<Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E-2" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#626-640" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-6" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key-6" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#627-639" title="goto source code">[src]</a></h4></div><h3 id="impl-ToDescriptorKey%3CCtx%3E-3" class="impl"><code class="in-band">impl<Ctx: <a class="trait" href="../../bdk/keys/trait.ScriptContext.html" title="trait bdk::keys::ScriptContext">ScriptContext</a>> ToDescriptorKey<Ctx> for <a class="enum" href="../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a></code><a href="#impl-ToDescriptorKey%3CCtx%3E-3" class="anchor"></a><a class="srclink" href="../../src/bdk/keys/mod.rs.html#652-668" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_descriptor_key-7" class="method hidden"><code>pub fn <a href="#method.to_descriptor_key-7" class="fnname">to_descriptor_key</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="enum" href="../../bdk/keys/enum.DescriptorKey.html" title="enum bdk::keys::DescriptorKey">DescriptorKey</a><Ctx>, <a class="enum" href="../../bdk/keys/enum.KeyError.html" title="enum bdk::keys::KeyError">KeyError</a>></code><a class="srclink" href="../../src/bdk/keys/mod.rs.html#653-667" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/bdk/keys/trait.ToDescriptorKey.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 `ValidNetworks` type in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, ValidNetworks"><title>bdk::keys::ValidNetworks - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition ValidNetworks</p><div class="sidebar-elems"><p class="location"><a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a></p><script>window.sidebarCurrent = {name: "ValidNetworks", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/keys/mod.rs.html#52" title="goto source code">[src]</a></span><span class="in-band">Type Definition <a href="../index.html">bdk</a>::<wbr><a href="index.html">keys</a>::<wbr><a class="type" href="">ValidNetworks</a></span></h1><pre class="rust typedef">type ValidNetworks = <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><Network>;</pre><div class="docblock"><p>Set of valid networks for a key</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=macro.descriptor.html">
+</head>
+<body>
+ <p>Redirecting to <a href="macro.descriptor.html">macro.descriptor.html</a>...</p>
+ <script>location.replace("macro.descriptor.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 `descriptor` macro 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">bdk</a></p><script>window.sidebarCurrent = {name: "descriptor", ty: "macro", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/dsl.rs.html#283-314" title="goto source code">[src]</a></span><span class="in-band">Macro <a href="index.html">bdk</a>::<wbr><a class="macro" href="">descriptor</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><div class="example-wrap"><pre class="rust macro">
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">descriptor</span> {
+ ( <span class="ident">bare</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sh</span> ( <span class="ident">wsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">shwsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">pk</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">pkh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">wpkh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sh</span> ( <span class="ident">wpkh</span> ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">shwpkh</span> ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">wsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+}</pre></div>
+</div><div class="docblock"><p>Macro to write full descriptors with code</p>
+<p>This macro expands to a <code>Result</code> of
+<a href="../bdk/descriptor/template/type.DescriptorTemplateOut.html"><code>DescriptorTemplateOut</code></a> and <a href="../bdk/enum.Error.html"><code>Error</code></a></p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>Signature plus timelock, equivalent to: <code>sh(wsh(and_v(v:pk(...), older(...))))</code></p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">my_key</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(<span class="string">"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">my_timelock</span> <span class="op">=</span> <span class="number">50</span>;
+<span class="kw">let</span> (<span class="ident">my_descriptor</span>, <span class="ident">my_keys_map</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span> ( <span class="ident">wsh</span> ( <span class="ident">and_v</span> (<span class="op">+</span><span class="ident">v</span> <span class="ident">pk</span> <span class="ident">my_key</span>), ( <span class="ident">older</span> <span class="ident">my_timelock</span> ))))<span class="question-mark">?</span>;</pre></div>
+<hr />
+<p>2-of-3 that becomes a 1-of-3 after a timelock has expired. Both <code>descriptor_a</code> and <code>descriptor_b</code> are equivalent: the first
+syntax is more suitable for a fixed number of items known at compile time, while the other accepts a
+<a href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="Vec"><code>Vec</code></a> of items, which makes it more suitable for writing dynamic descriptors.</p>
+<p>They both produce the descriptor: <code>wsh(thresh(2,pk(...),s:pk(...),sdv:older(...)))</code></p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">my_key_1</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(<span class="string">"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">my_key_2</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy"</span>)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">my_timelock</span> <span class="op">=</span> <span class="number">50</span>;
+
+<span class="kw">let</span> (<span class="ident">descriptor_a</span>, <span class="ident">key_map_a</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span> {
+ <span class="ident">wsh</span> (
+ <span class="ident">thresh</span> <span class="number">2</span>, (<span class="ident">pk</span> <span class="ident">my_key_1</span>), (<span class="op">+</span><span class="ident">s</span> <span class="ident">pk</span> <span class="ident">my_key_2</span>), (<span class="op">+</span><span class="ident">s</span><span class="op">+</span><span class="ident">d</span><span class="op">+</span><span class="ident">v</span> <span class="ident">older</span> <span class="ident">my_timelock</span>)
+ )
+}<span class="question-mark">?</span>;
+
+<span class="kw">let</span> <span class="ident">b_items</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[
+ <span class="ident">bdk</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="ident">pk</span> <span class="ident">my_key_1</span>)<span class="question-mark">?</span>,
+ <span class="ident">bdk</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="op">+</span><span class="ident">s</span> <span class="ident">pk</span> <span class="ident">my_key_2</span>)<span class="question-mark">?</span>,
+ <span class="ident">bdk</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="op">+</span><span class="ident">s</span><span class="op">+</span><span class="ident">d</span><span class="op">+</span><span class="ident">v</span> <span class="ident">older</span> <span class="ident">my_timelock</span>)<span class="question-mark">?</span>,
+];
+<span class="kw">let</span> (<span class="ident">descriptor_b</span>, <span class="kw-2">mut</span> <span class="ident">key_map_b</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span>( <span class="ident">wsh</span> ( <span class="ident">thresh_vec</span> <span class="number">2</span>, <span class="ident">b_items</span> ) )<span class="question-mark">?</span>;
+
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">descriptor_a</span>, <span class="ident">descriptor_b</span>);
+<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">key_map_a</span>.<span class="ident">len</span>(), <span class="ident">key_map_b</span>.<span class="ident">len</span>());</pre></div>
+<hr />
+<p>Simple 2-of-2 multi-signature, equivalent to: <code>wsh(multi(2, ...))</code></p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">my_key_1</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"</span>,
+)<span class="question-mark">?</span>;
+<span class="kw">let</span> <span class="ident">my_key_2</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy"</span>)<span class="question-mark">?</span>;
+
+<span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">key_map</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span> {
+ <span class="ident">wsh</span> (
+ <span class="ident">multi</span> <span class="number">2</span>, <span class="ident">my_key_1</span>, <span class="ident">my_key_2</span>
+ )
+}<span class="question-mark">?</span>;</pre></div>
+<hr />
+<p>Native-Segwit single-sig, equivalent to: <code>wpkh(...)</code></p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="ident">my_key</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy"</span>)<span class="question-mark">?</span>;
+
+<span class="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">key_map</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="ident">bdk</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">my_key</span>))<span class="question-mark">?</span>;</pre></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=macro.fragment.html">
+</head>
+<body>
+ <p>Redirecting to <a href="macro.fragment.html">macro.fragment.html</a>...</p>
+ <script>location.replace("macro.fragment.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 `fragment` macro in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, fragment"><title>bdk::fragment - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">bdk</a></p><script>window.sidebarCurrent = {name: "fragment", ty: "macro", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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/dsl.rs.html#321-458" title="goto source code">[src]</a></span><span class="in-band">Macro <a href="index.html">bdk</a>::<wbr><a class="macro" href="">fragment</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><div class="example-wrap"><pre class="rust macro">
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">fragment</span> {
+ ( <span class="op">+</span><span class="ident">a</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">s</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">c</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">d</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">v</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">j</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">n</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">t</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">l</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="op">+</span><span class="ident">u</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="bool-val">true</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="bool-val">false</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">pk_k</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">pk</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">pk_h</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key_hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">after</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">older</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sha256</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">hash256</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">ripemd160</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">hash160</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">and_v</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">and_b</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">and_or</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">c</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">or_b</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">or_d</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">or_c</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">or_i</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">thresh_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">items</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">thresh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span> $(, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">item</span>:<span class="ident">tt</span> )<span class="op">*</span> ) )<span class="op">+</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">multi_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">keys</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">multi</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span> $(, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> )<span class="op">+</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sortedmulti</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+ ( <span class="ident">sortedmulti_vec</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> { ... };
+}</pre></div>
+</div><div class="docblock"><p>Macro to write descriptor fragments with code</p>
+<p>This macro will be expanded to an object of type <code>Result<(Miniscript<DescriptorPublicKey, _>, KeyMap, ValidNetworks), Error></code>. It allows writing
+fragments of larger descriptors that can be pieced together using <code>fragment!(thresh_vec ...)</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
+initSidebarItems({"enum":[["Error","Errors that can be thrown by the `Wallet`"],["KeychainKind","Types of keychains"]],"macro":[["descriptor","Macro to write full descriptors with code"],["fragment","Macro to write descriptor fragments with code"]],"mod":[["blockchain","Blockchain backends"],["database","Database types"],["descriptor","Descriptors"],["keys","Key formats"],["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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#63" 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#65-85" 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/bdk/types.rs.html#67-69" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a new instance of <a href="../bdk/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/bdk/types.rs.html#72-74" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a new instance of <a href="../bdk/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/bdk/types.rs.html#77-79" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a new <a href="../bdk/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/bdk/types.rs.html#82-84" 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#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#61" 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>pub 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#128-130" 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#61" 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#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#61" 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#87-91" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#88-90" 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#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#61" 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>pub 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#61" 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#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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#61" 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>pub 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#61" 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>pub 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#61" 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>pub 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#61" 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>pub 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#61" 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#61" 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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#106-121" 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>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><div class="docblock"><p>Optional transaction</p>
+</div><span id="structfield.txid" class="structfield small-section-header"><a href="#structfield.txid" class="anchor field"></a><code>txid: Txid</code></span><div class="docblock"><p>Transaction id</p>
+</div><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><div class="docblock"><p>Timestamp</p>
+</div><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><div class="docblock"><p>Received value (sats)</p>
+</div><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><div class="docblock"><p>Sent value (sats)</p>
+</div><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><div class="docblock"><p>Fee value (sats)</p>
+</div><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><div class="docblock"><p>Confirmed in block height, <code>None</code> means unconfirmed</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/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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#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>pub 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#128-130" 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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#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-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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#105" 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.118/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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../src/bdk/types.rs.html#105" 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.118/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#105" 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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#105" 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>pub 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#105" 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.118/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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../src/bdk/types.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.118/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#105" 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#105" 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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><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.keychain">keychain</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#95-102" 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 keychain: <a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><div class="docblock"><p>Reference to a transaction output</p>
+</div><span id="structfield.txout" class="structfield small-section-header"><a href="#structfield.txout" class="anchor field"></a><code>txout: TxOut</code></span><div class="docblock"><p>Transaction output</p>
+</div><span id="structfield.keychain" class="structfield small-section-header"><a href="#structfield.keychain" class="anchor field"></a><code>keychain: <a class="enum" href="../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a></code></span><div class="docblock"><p>Type of keychain</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/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#94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#94" 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>pub 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#128-130" 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#94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#94" 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.118/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#94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class="srclink" href="../src/bdk/types.rs.html#94" 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.118/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#94" 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#94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#94" 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>pub 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#94" 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.118/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#94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../src/bdk/types.rs.html#94" 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.118/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#94" 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#94" 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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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.KeychainKind.html">
+</head>
+<body>
+ <p>Redirecting to <a href="../../bdk/enum.KeychainKind.html">../../bdk/enum.KeychainKind.html</a>...</p>
+ <script>location.replace("../../bdk/enum.KeychainKind.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/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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-97" 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>UserRejected</code></div><div class="docblock"><p>User rejected the address</p>
+</div><div id="variant.ConnectionError" class="variant small-section-header"><a href="#variant.ConnectionError" class="anchor field"></a><code>ConnectionError</code></div><div class="docblock"><p>Network connection error</p>
+</div><div id="variant.TimeoutError" class="variant small-section-header"><a href="#variant.TimeoutError" class="anchor field"></a><code>TimeoutError</code></div><div class="docblock"><p>Network request timeout error</p>
+</div><div id="variant.InvalidScript" class="variant small-section-header"><a href="#variant.InvalidScript" class="anchor field"></a><code>InvalidScript</code></div><div class="docblock"><p>Invalid script</p>
+</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><div class="docblock"><p>A custom error message</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/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>pub 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>pub 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#128-130" 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>pub 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#99-103" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#100-102" 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#105" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#166" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#166" 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>pub 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>pub 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-167" 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="../../../bdk/wallet/struct.Wallet.html"><code>Wallet</code></a> by using the
+<a href="../../../bdk/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="../../../bdk/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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#114-122" 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: <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> {
+ pub fn <a href="#tymethod.validate" class="fnname">validate</a>(<br> &self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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="../../../bdk/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="../../../bdk/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>pub fn <a href="#tymethod.validate" class="fnname">validate</a>(<br> &self, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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><a class="srclink" href="../../../src/bdk/wallet/address_validator.rs.html#116-121" title="goto source code">[src]</a></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 `TXIN_BASE_WEIGHT` constant in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, TXIN_BASE_WEIGHT"><title>bdk::wallet::coin_selection::TXIN_BASE_WEIGHT - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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 rust-logo'><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">coin_selection</a></p><script>window.sidebarCurrent = {name: "TXIN_BASE_WEIGHT", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#119" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">bdk</a>::<wbr><a href="../index.html">wallet</a>::<wbr><a href="index.html">coin_selection</a>::<wbr><a class="constant" href="">TXIN_BASE_WEIGHT</a></span></h1><pre class="rust const">pub const TXIN_BASE_WEIGHT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = (32 + 4 + 4 + 1) * 4; // 0x0_000_000_000_000_0a4usize</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 `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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-997" 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 <a href="../../../bdk/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="../../../bdk/wallet/struct.Wallet.html"><code>Wallet</code></a>, instead it
+is selected whenever a <a href="../../../bdk/wallet/struct.Wallet.html#method.create_tx"><code>Wallet::create_tx</code></a> call is made, through
+the use of the <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html"><code>TxBuilder</code></a> structure, specifically with
+<a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection"><code>TxBuilder::coin_selection</code></a> method.</p>
+<p>The <a href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="DefaultCoinSelectionAlgorithm"><code>DefaultCoinSelectionAlgorithm</code></a> selects the default coin selection algorithm that
+<a href="../../../bdk/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="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></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">database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>,
+ <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></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">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="kw-2">mut</span> <span class="ident">selected_amount</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">additional_weight</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="ident">all_utxos_selected</span> <span class="op">=</span> <span class="ident">required_utxos</span>
+ .<span class="ident">into_iter</span>().<span class="ident">chain</span>(<span class="ident">optional_utxos</span>)
+ .<span class="ident">scan</span>((<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">selected_amount</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">additional_weight</span>), <span class="op">|</span>(<span class="ident">selected_amount</span>, <span class="ident">additional_weight</span>), (<span class="ident">utxo</span>, <span class="ident">weight</span>)<span class="op">|</span> {
+ <span class="kw-2">*</span><span class="kw-2">*</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="kw-2">*</span><span class="kw-2">*</span><span class="ident">additional_weight</span> <span class="op">+</span><span class="op">=</span> <span class="ident">TXIN_BASE_WEIGHT</span> <span class="op">+</span> <span class="ident">weight</span>;
+
+ <span class="prelude-val">Some</span>(<span class="ident">utxo</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_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">selected</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.BranchAndBoundCoinSelection.html" title="bdk::wallet::coin_selection::BranchAndBoundCoinSelection struct">BranchAndBoundCoinSelection</a></td><td class="docblock-short"><p>Branch and bound coin selection</p>
+</td></tr><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.LargestFirstCoinSelection.html" title="bdk::wallet::coin_selection::LargestFirstCoinSelection struct">LargestFirstCoinSelection</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="../../../bdk/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 = "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":[["BranchAndBoundCoinSelection","Branch and bound coin selection"],["CoinSelectionResult","Result of a successful coin selection"],["LargestFirstCoinSelection","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 `BranchAndBoundCoinSelection` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BranchAndBoundCoinSelection"><title>bdk::wallet::coin_selection::BranchAndBoundCoinSelection - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BranchAndBoundCoinSelection</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-CoinSelectionAlgorithm%3CD%3E">CoinSelectionAlgorithm<D></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "BranchAndBoundCoinSelection", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#265-267" 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="">BranchAndBoundCoinSelection</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BranchAndBoundCoinSelection { /* fields omitted */ }</pre></div><div class="docblock"><p>Branch and bound coin selection</p>
+<p>Code adapted from Bitcoin Core's implementation and from Mark Erhardt Master's Thesis: <a href="http://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf">http://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf</a></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/coin_selection/struct.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#278-283" 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>(size_of_change: <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/coin_selection.rs.html#280-282" title="goto source code">[src]</a></h4><div class="docblock"><p>Create new instance with target size for change output</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-CoinSelectionAlgorithm%3CD%3E" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-CoinSelectionAlgorithm%3CD%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#287-347" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.coin_select" class="method hidden"><code>pub fn <a href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select" class="fnname">coin_select</a>(<br> &self, <br> _database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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#288-346" 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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#264" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#264" 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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#269-276" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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/coin_selection.rs.html#270-275" 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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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">selected</a><a href="#structfield.selected_amount">selected_amount</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#124-131" 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 selected: <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>>,
+ 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.selected" class="structfield small-section-header"><a href="#structfield.selected" class="anchor field"></a><code>selected: <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>></code></span><div class="docblock"><p>List of outputs selected for use as inputs</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="../../../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#123" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#123" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `LargestFirstCoinSelection` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, LargestFirstCoinSelection"><title>bdk::wallet::coin_selection::LargestFirstCoinSelection - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct LargestFirstCoinSelection</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%3CD%3E">CoinSelectionAlgorithm<D></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "LargestFirstCoinSelection", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#168" 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="">LargestFirstCoinSelection</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct LargestFirstCoinSelection;</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%3CD%3E" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-CoinSelectionAlgorithm%3CD%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#170-234" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.coin_select" class="method hidden"><code>pub fn <a href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html#tymethod.coin_select" class="fnname">coin_select</a>(<br> &self, <br> _database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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#171-233" 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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#167" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#167" 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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#167" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#167" 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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#139-161" 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<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
+ pub fn <a href="#tymethod.coin_select" class="fnname">coin_select</a>(<br> &self, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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="../../../bdk/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="../../../bdk/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>pub fn <a href="#tymethod.coin_select" class="fnname">coin_select</a>(<br> &self, <br> database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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#152-160" title="goto source code">[src]</a></h3><div class="docblock"><p>Perform the coin selection</p>
+<ul>
+<li><code>database</code>: a reference to the wallet's database that can be used to lookup additional
+details for a specific UTXO</li>
+<li><code>required_utxos</code>: the utxos that must be spent regardless of <code>amount_needed</code> with their
+weight cost</li>
+<li><code>optional_utxos</code>: the remaining available utxos to satisfy <code>amount_needed</code> with their
+weight cost</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>fee_amount</code>: the amount of fees in satoshi already accumulated from adding outputs and
+the transaction's header</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%3CD%3E" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> CoinSelectionAlgorithm<D> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a></code><a href="#impl-CoinSelectionAlgorithm%3CD%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#287-347" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.coin_select" class="method hidden"><code>pub fn <a href="#method.coin_select" class="fnname">coin_select</a>(<br> &self, <br> _database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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#288-346" title="goto source code">[src]</a></h4></div><h3 id="impl-CoinSelectionAlgorithm%3CD%3E-1" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> CoinSelectionAlgorithm<D> for <a class="struct" href="../../../bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html" title="struct bdk::wallet::coin_selection::LargestFirstCoinSelection">LargestFirstCoinSelection</a></code><a href="#impl-CoinSelectionAlgorithm%3CD%3E-1" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/coin_selection.rs.html#170-234" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.coin_select-1" class="method hidden"><code>pub fn <a href="#method.coin_select-1" class="fnname">coin_select</a>(<br> &self, <br> _database: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>D, <br> required_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, <br> optional_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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><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.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</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> 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#171-233" 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#114" 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.BranchAndBoundCoinSelection.html" title="struct bdk::wallet::coin_selection::BranchAndBoundCoinSelection">BranchAndBoundCoinSelection</a>;</pre><div class="docblock"><p>Default coin selection algorithm used by <a href="../../../bdk/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 = "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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-343" 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_ref</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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#89-95" 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="../../../bdk/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="../../../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#111-200" 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="../../../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#123-161" 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/bdk/wallet/export.rs.html#186-188" 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/bdk/wallet/export.rs.html#191-199" 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#88" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#88" 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.118/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#88" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deserialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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#88" 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.118/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/traits/trait.FromStr.html" title="trait core::str::traits::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#103-109" 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/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = <a class="struct" href="https://docs.rs/serde_json/1.0.60/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>pub fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/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/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>></code><a class="srclink" href="../../../src/bdk/wallet/export.rs.html#106-108" 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/traits/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.118/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#88" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.serialize" class="method hidden"><code>pub fn <a href="https://docs.rs/serde/1.0.118/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.118/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.118/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.118/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class="srclink" href="../../../src/bdk/wallet/export.rs.html#88" 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.118/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#97-101" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#98-100" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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.118/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.118/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.118/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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-3411" 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 <a href="../../bdk/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="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 <a href="../../bdk/wallet/struct.Wallet.html" title="Wallet"><code>Wallet</code></a> that uses <a href="../../bdk/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 = "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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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.InvalidKey">InvalidKey</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.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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#137-156" 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,
+ InvalidKey,
+ UserCanceled,
+ 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.InvalidKey" class="variant small-section-header"><a href="#variant.InvalidKey" class="anchor field"></a><code>InvalidKey</code></div><div class="docblock"><p>The private key in use has the right fingerprint but derives differently than expected</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.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="../../../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#136" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#136" 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>pub 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#128-130" 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#136" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#136" 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#158-162" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub 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#159-161" 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#136" 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#164" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub 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>pub 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="item-info 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>pub 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="item-info 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'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub 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="item-info 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#168" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#168" 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#136" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#136" 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>pub 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#209-211" 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#136" 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#136" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub 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#2200-2206" 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Ord">Ord</a><a href="#impl-PartialEq%3CSignerId%3E">PartialEq<SignerId></a><a href="#impl-PartialOrd%3CSignerId%3E">PartialOrd<SignerId></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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#116-121" 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 {
+ PkHash(Hash),
+ 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(Hash)</code></div><div class="docblock"><p>Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA public key</p>
+</div><div id="variant.Fingerprint" class="variant small-section-header"><a href="#variant.Fingerprint" class="anchor field"></a><code>Fingerprint(Fingerprint)</code></div><div class="docblock"><p>The fingerprint of a BIP32 extended key</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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" 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>pub 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#128-130" 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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#115" 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/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" 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></code><a href="#impl-From%3CFingerprint%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#129-133" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#130-132" 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></code><a href="#impl-From%3CHash%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#123-127" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#124-126" 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 <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></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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#115" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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%3CSignerId%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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-PartialEq%3CSignerId%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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>) -> <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#115" 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>pub 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>) -> <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#115" 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%3CSignerId%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/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>> for <a class="enum" href="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-PartialOrd%3CSignerId%3E" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" 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>pub 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/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" 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>pub 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/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" 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>pub 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/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" 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>pub 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/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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#115" 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/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" 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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#115" 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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-676" 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="../../../bdk/wallet/struct.Wallet.html"><code>Wallet</code></a>
+through the <a href="../../../bdk/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="ident">_secp</span>: <span class="kw-2">&</span><span class="ident">Secp256k1</span><span class="op"><</span><span class="ident">All</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">KeychainKind</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">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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#302" 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#301" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#301" 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>pub 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#128-130" 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#301" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#301" 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#304-308" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#305-307" 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#301" 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#301" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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#301" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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#301" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#301" 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>pub 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#301" 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#301" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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#301" 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>pub 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#301" 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>pub 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#301" 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>pub 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#301" 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>pub 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#301" 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#301" 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#301" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#327" 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(_);</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></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#329-338" 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, secp: &Secp256k1<All>) -> <a class="type" href="../../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#331-337" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a map of public keys to secret keys</p>
+</div></div><h3 id="impl-1" 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></code><a href="#impl-1" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#369-415" 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/bdk/wallet/signer.rs.html#371-373" 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="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>, <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><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><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#377-384" 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 previously 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="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>, <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><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#387-389" 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="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#392-397" 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><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#400-402" 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="../../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</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/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</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#405-414" 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 <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></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#326" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#326" 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>pub 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#128-130" 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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#326" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#326" 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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#326" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#326" 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><<a class="enum" href="../../../bdk/keys/enum.DescriptorPublicKey.html" title="enum bdk::keys::DescriptorPublicKey">DescriptorPublicKey</a>, <a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>, <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></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#340-367" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(keymap: <a class="type" href="../../../bdk/descriptor/type.KeyMap.html" title="type bdk::descriptor::KeyMap">KeyMap</a>) -> <a class="struct" href="../../../bdk/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#341-366" 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/wallet/signer/struct.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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.SignersContainer.html" title="struct bdk::wallet::signer::SignersContainer">SignersContainer</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#170-195" 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> + <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> {
+ pub 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> secp: &Secp256k1<All><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> pub 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>;
+
+ pub 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><<a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>> { ... }
+}</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="../../../bdk/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>pub 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> secp: &Secp256k1<All><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#176-181" title="goto source code">[src]</a></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="../../../bdk/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>pub 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><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#185" title="goto source code">[src]</a></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>pub 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><<a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#192-194" title="goto source code">[src]</a></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#197-240" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sign" class="method hidden"><code>pub 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> secp: &Secp256k1<All><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#198-231" title="goto source code">[src]</a></h4><h4 id="method.sign_whole_tx" class="method hidden"><code>pub 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#233-235" title="goto source code">[src]</a></h4><h4 id="method.descriptor_secret_key-1" class="method hidden"><code>pub 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><<a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#237-239" 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#242-294" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sign-1" class="method hidden"><code>pub 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> secp: &Secp256k1<All><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#243-282" title="goto source code">[src]</a></h4><h4 id="method.sign_whole_tx-1" class="method hidden"><code>pub 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#284-286" title="goto source code">[src]</a></h4><h4 id="method.descriptor_secret_key-2" class="method hidden"><code>pub 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><<a class="enum" href="../../../bdk/keys/enum.DescriptorSecretKey.html" title="enum bdk::keys::DescriptorSecretKey">DescriptorSecretKey</a>></code><a class="srclink" href="../../../src/bdk/wallet/signer.rs.html#288-293" 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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.network">network</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.secp_ctx">secp_ctx</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#89-106" 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, D> { /* fields omitted */ }</pre></div><div class="docblock"><p>A Bitcoin wallet</p>
+<p>A wallet takes descriptors, a <a href="../../bdk/database/trait.Database.html"><code>database</code></a> and a
+<a href="../../bdk/blockchain/trait.Blockchain.html"><code>blockchain</code></a> and implements the basic functions that a Bitcoin wallets
+needs to operate, like <a href="../../bdk/wallet/struct.Wallet.html#method.get_new_address">generating addresses</a>, <a href="../../bdk/wallet/struct.Wallet.html#method.get_balance">returning the balance</a>,
+<a href="../../bdk/wallet/struct.Wallet.html#method.create_tx">creating transactions</a>, etc.</p>
+<p>A wallet can be either "online" if the <a href="../../bdk/blockchain/index.html"><code>blockchain</code></a> type provided
+implements <a href="../../bdk/blockchain/trait.Blockchain.html" title="Blockchain"><code>Blockchain</code></a>, or "offline" <a href="../../bdk/blockchain/struct.OfflineBlockchain.html" title="OfflineBlockchain"><code>OfflineBlockchain</code></a> 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#109-1306" 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><E: <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a>>(<br> descriptor: E, <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><E>, <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#115-161" 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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#164-172" 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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#175-177" 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="../../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#183-185" 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="../../bdk/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="../../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#194-196" 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="../../bdk/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="../../bdk/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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#202-207" 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="../../bdk/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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a>, <br> id: <a class="enum" href="../../bdk/wallet/signer/enum.SignerId.html" title="enum bdk::wallet::signer::SignerId">SignerId</a>, <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><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#212-225" title="goto source code">[src]</a></h4><div class="docblock"><p>Add an external signer</p>
+<p>See <a href="../../bdk/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>(&mut self, validator: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../../bdk/wallet/address_validator/trait.AddressValidator.html" title="trait bdk::wallet::address_validator::AddressValidator">AddressValidator</a>>)</code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#230-232" title="goto source code">[src]</a></h4><div class="docblock"><p>Add an address validator</p>
+<p>See <a href="../../bdk/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="../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>>(<br> &self, <br> builder: <a class="struct" href="../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, <a class="struct" href="../../bdk/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</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="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#252-538" 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="../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>>(<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><D, Cs, <a class="struct" href="../../bdk/wallet/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</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="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#571-810" 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="../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.set_single_recipient" title="TxBuilder::set_single_recipient"><code>TxBuilder::set_single_recipient</code></a>,
+the <a href="../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.maintain_single_recipient" title="TxBuilder::maintain_single_recipient"><code>TxBuilder::maintain_single_recipient</code></a> flag should be enabled to correctly reduce the
+only output's value in order to increase the fees.</p>
+<p>If the <code>builder</code> specifies some <code>utxos</code> that must be spent, they will be added to the
+transaction regardless of whether they are necessary or not to cover additional 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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#827-848" 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="../../bdk/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, keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#851-861" 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> keychain: <a class="enum" href="../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</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#867-876" 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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#879-959" title="goto source code">[src]</a></h4><div class="docblock"><p>Try to finalize a PSBT</p>
+</div><h4 id="method.secp_ctx" class="method"><code>pub fn <a href="#method.secp_ctx" class="fnname">secp_ctx</a>(&self) -> &Secp256k1<All></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#962-964" title="goto source code">[src]</a></h4><div class="docblock"><p>Return the secp256k1 context used for all signing operations</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#1308-1410" 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><E: <a class="trait" href="../../bdk/descriptor/trait.ToWalletDescriptor.html" title="trait bdk::descriptor::ToWalletDescriptor">ToWalletDescriptor</a>>(<br> descriptor: E, <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><E>, <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#1315-1328" 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="../../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#1332-1387" 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="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#1390-1392" title="goto source code">[src]</a></h4><div class="docblock"><p>Return a reference to the internal blockchain client</p>
+</div><h4 id="method.network" class="method"><code>pub fn <a href="#method.network" class="fnname">network</a>(&self) -> Network</code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#1395-1397" title="goto source code">[src]</a></h4><div class="docblock"><p>Get the Bitcoin network the wallet is using.</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="../../bdk/enum.Error.html" title="enum bdk::Error">Error</a>></code><a class="srclink" href="../../src/bdk/wallet/mod.rs.html#1401-1409" 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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br> D: <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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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="../../../bdk/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="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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#50-53" 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 {
+ pub 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>pub 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><a class="srclink" href="../../src/bdk/wallet/utils.rs.html#52" title="goto source code">[src]</a></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#55-59" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.is_dust" class="method hidden"><code>pub 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#56-58" 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#570-577" 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>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="../../../bdk/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="../../../bdk/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="../../../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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#569" 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>pub 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#128-130" 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#569" 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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#569" 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#579-583" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#580-582" 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#569" 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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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#569" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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#569" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#569" 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>pub 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#209-211" 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#569" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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#569" 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>pub 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#959-961" 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>pub 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#978-980" 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>pub 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#996-998" 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>pub 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#1015-1017" 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#569" 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#569" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#495-502" 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>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="../../../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#510-536" 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/bdk/wallet/tx_builder.rs.html#512-535" title="goto source code">[src]</a></h4><div class="docblock"><p>Sort transaction inputs and outputs by <a href="../../../bdk/wallet/tx_builder/enum.TxOrdering.html" title="TxOrdering"><code>TxOrdering</code></a> variant</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="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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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#494" 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>pub 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#128-130" 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#494" 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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#494" 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#504-508" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#505-507" 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#494" 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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub 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#494" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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>pub 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#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub 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#494" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> 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>pub 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#719-724" 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>pub 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#739-744" 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>pub 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><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub 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#494" 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>pub 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#209-211" 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#494" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub 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#494" 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>pub 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#959-961" 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>pub 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#978-980" 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>pub 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#996-998" 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>pub 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#1015-1017" 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#494" 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#494" 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>pub 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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><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: "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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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-738" 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.BumpFee.html" title="bdk::wallet::tx_builder::BumpFee struct">BumpFee</a></td><td class="docblock-short"><p><a href="../../../bdk/wallet/struct.Wallet.html#method.bump_fee"><code>Wallet::bump_fee</code></a> context</p>
+</td></tr><tr class="module-item"><td><a class="struct" href="struct.CreateTx.html" title="bdk::wallet::tx_builder::CreateTx struct">CreateTx</a></td><td class="docblock-short"><p><a href="../../../bdk/wallet/struct.Wallet.html#method.create_tx"><code>Wallet::create_tx</code></a> context</p>
+</td></tr><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><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
+<table><tr class="module-item"><td><a class="trait" href="trait.TxBuilderContext.html" title="bdk::wallet::tx_builder::TxBuilderContext trait">TxBuilderContext</a></td><td class="docblock-short"><p>Context in which the <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="TxBuilder"><code>TxBuilder</code></a> is valid</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":[["BumpFee","`Wallet::bump_fee` context"],["CreateTx","`Wallet::create_tx` context"],["TxBuilder","A transaction builder"]],"trait":[["TxBuilderContext","Context in which the [`TxBuilder`] is valid"]]});
\ 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 `BumpFee` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, BumpFee"><title>bdk::wallet::tx_builder::BumpFee - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BumpFee</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-TxBuilderContext">TxBuilderContext</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "BumpFee", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#66" 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="">BumpFee</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BumpFee;</pre></div><div class="docblock"><p><a href="../../../bdk/wallet/struct.Wallet.html#method.bump_fee"><code>Wallet::bump_fee</code></a> context</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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#65" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#65" 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>pub 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#128-130" 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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#65" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#65" 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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#65" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#65" 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-TxBuilderContext" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-TxBuilderContext" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#67" 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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `CreateTx` struct in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, CreateTx"><title>bdk::wallet::tx_builder::CreateTx - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct CreateTx</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-TxBuilderContext">TxBuilderContext</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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: "CreateTx", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#61" 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="">CreateTx</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct CreateTx;</pre></div><div class="docblock"><p><a href="../../../bdk/wallet/struct.Wallet.html#method.create_tx"><code>Wallet::create_tx</code></a> context</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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub 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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#60" 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>pub 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#128-130" 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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#60" 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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#60" 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-TxBuilderContext" class="impl"><code class="in-band">impl <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</a> for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-TxBuilderContext" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.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/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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>pub 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>pub 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="item-info 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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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_global_xpubs">add_global_xpubs</a><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.drain_wallet">drain_wallet</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_absolute">fee_absolute</a><a href="#method.fee_rate">fee_rate</a><a href="#method.force_non_witness_utxo">force_non_witness_utxo</a><a href="#method.include_output_redeem_witness_script">include_output_redeem_witness_script</a><a href="#method.maintain_single_recipient">maintain_single_recipient</a><a href="#method.manually_selected_only">manually_selected_only</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.set_recipients">set_recipients</a><a href="#method.set_single_recipient">set_single_recipient</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-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Pointable">Pointable</a><a href="#impl-Same%3CT%3E">Same<T></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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#75-97" 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<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>, Ctx: <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</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="../../../bdk/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<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, Ctx: <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</a>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, <a class="type" href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="type bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm">DefaultCoinSelectionAlgorithm</a>, Ctx></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#145-150" 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/bdk/wallet/tx_builder.rs.html#147-149" title="goto source code">[src]</a></h4><div class="docblock"><p>Create an empty builder</p>
+</div></div><h3 id="impl-1" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>, Ctx: <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</a>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx></code><a href="#impl-1" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#153-406" title="goto source code">[src]</a></h3><div class="impl-items"><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="../../../bdk/struct.FeeRate.html" title="struct bdk::FeeRate">FeeRate</a>) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#155-158" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a custom fee rate</p>
+</div><h4 id="method.fee_absolute" class="method"><code>pub fn <a href="#method.fee_absolute" class="fnname">fee_absolute</a>(self, fee_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#161-164" title="goto source code">[src]</a></h4><div class="docblock"><p>Set an absolute fee</p>
+</div><h4 id="method.policy_path" class="method"><code>pub fn <a href="#method.policy_path" class="fnname">policy_path</a>(<br> self, <br> 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>>>, <br> keychain: <a class="enum" href="../../../bdk/enum.KeychainKind.html" title="enum bdk::KeychainKind">KeychainKind</a><br>) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#221-233" title="goto source code">[src]</a></h4><div class="docblock"><p>Set the policy path to use while creating the transaction for a given keychain.</p>
+<p>This method accepts a map where the key is the policy node id (see
+<a href="../../../bdk/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="../../../bdk/descriptor/policy/enum.SatisfiableItem.html#variant.Thresh.field.items"><code>SatisfiableItem::Thresh::items</code></a>).</p>
+<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
+<p>An example of when the policy path is needed is the following descriptor:
+<code>wsh(thresh(2,pk(A),sj:and_v(v:pk(B),n:older(6)),snj:and_v(v:pk(C),after(630000))))</code>,
+derived from the miniscript policy <code>thresh(2,pk(A),and(pk(B),older(6)),and(pk(C),after(630000)))</code>.
+It declares three descriptor fragments, and at the top level it uses <code>thresh()</code> to
+ensure that at least two of them are satisfied. The individual fragments are:</p>
+<ol>
+<li><code>pk(A)</code></li>
+<li><code>and(pk(B),older(6))</code></li>
+<li><code>and(pk(C),after(630000))</code></li>
+</ol>
+<p>When those conditions are combined in pairs, it's clear that the transaction needs to be created
+differently depending on how the user intends to satisfy the policy afterwards:</p>
+<ul>
+<li>If fragments <code>1</code> and <code>2</code> are used, the transaction will need to use a specific
+<code>n_sequence</code> in order to spend an <code>OP_CSV</code> branch.</li>
+<li>If fragments <code>1</code> and <code>3</code> are used, the transaction will need to use a specific <code>locktime</code>
+in order to spend an <code>OP_CLTV</code> branch.</li>
+<li>If fragments <code>2</code> and <code>3</code> are used, the transaction will need both.</li>
+</ul>
+<p>When the spending policy is represented as a tree (see
+<a href="../../../bdk/wallet/struct.Wallet.html#method.policies"><code>Wallet::policies</code></a>), every node
+is assigned a unique identifier that can be used in the policy path to specify which of
+the node's children the user intends to satisfy: for instance, assuming the <code>thresh()</code>
+root node of this example has an id of <code>aabbccdd</code>, the policy path map would look like:</p>
+<p><code>{ "aabbccdd" => [0, 1] }</code></p>
+<p>where the key is the node's id, and the value is a list of the children that should be
+used, in no particular order.</p>
+<p>If a particularly complex descriptor has multiple ambiguous thresholds in its structure,
+multiple entries can be added to the map, one for each node that requires an explicit path.</p>
+
+<div class="example-wrap"><pre class="rust rust-example-rendered">
+<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+<span class="ident">path</span>.<span class="ident">insert</span>(<span class="string">"aabbccdd"</span>.<span class="ident">to_string</span>(), <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>, <span class="number">1</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">policy_path</span>(<span class="ident">path</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>);</pre></div>
+</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/bdk/wallet/tx_builder.rs.html#239-242" 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/bdk/wallet/tx_builder.rs.html#248-251" 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.manually_selected_only" class="method"><code>pub fn <a href="#method.manually_selected_only" class="fnname">manually_selected_only</a>(self) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#260-263" title="goto source code">[src]</a></h4><div class="docblock"><p>Only spend utxos added by <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_utxo"><code>add_utxo</code></a> and <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.utxos"><code>utxos</code></a>.</p>
+<p>The wallet will <strong>not</strong> add additional utxos to the transaction even if they are needed to
+make the transaction valid.</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/bdk/wallet/tx_builder.rs.html#270-273" 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="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.utxos" title="TxBuilder::utxos"><code>TxBuilder::utxos</code></a> and
+<a href="../../../bdk/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/bdk/wallet/tx_builder.rs.html#280-283" 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="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.utxos" title="TxBuilder::utxos"><code>TxBuilder::utxos</code></a> and
+<a href="../../../bdk/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/bdk/wallet/tx_builder.rs.html#288-291" 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="../../../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#294-297" 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/bdk/wallet/tx_builder.rs.html#302-305" 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.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.i32.html">i32</a>) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#311-314" 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/bdk/wallet/tx_builder.rs.html#320-323" 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="../../../bdk/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/bdk/wallet/tx_builder.rs.html#329-332" 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="../../../bdk/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="../../../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#336-339" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a specific <a href="../../../bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html" title="ChangeSpendPolicy"><code>ChangeSpendPolicy</code></a>. See <a href="../../../bdk/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="../../../bdk/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/bdk/wallet/tx_builder.rs.html#345-348" 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.include_output_redeem_witness_script" class="method"><code>pub fn <a href="#method.include_output_redeem_witness_script" class="fnname">include_output_redeem_witness_script</a>(self) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#354-357" title="goto source code">[src]</a></h4><div class="docblock"><p>Fill-in the <a href="bitcoin::util::psbt::Output::redeem_script"><code>psbt::Output::redeem_script</code></a> and
+<a href="bitcoin::util::psbt::Output::witness_script"><code>psbt::Output::witness_script</code></a> fields.</p>
+<p>This is useful for signers which always require it, like ColdCard hardware wallets.</p>
+</div><h4 id="method.add_global_xpubs" class="method"><code>pub fn <a href="#method.add_global_xpubs" class="fnname">add_global_xpubs</a>(self) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#364-367" title="goto source code">[src]</a></h4><div class="docblock"><p>Fill-in the <code>PSBT_GLOBAL_XPUB</code> field with the extended keys contained in both the external
+and internal descriptors</p>
+<p>This is useful for offline signers that take part to a multisig. Some hardware wallets like
+BitBox and ColdCard are known to require this.</p>
+</div><h4 id="method.drain_wallet" class="method"><code>pub fn <a href="#method.drain_wallet" class="fnname">drain_wallet</a>(self) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#370-373" title="goto source code">[src]</a></h4><div class="docblock"><p>Spend all the available inputs. This respects filters like <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.unspendable" title="TxBuilder::unspendable"><code>TxBuilder::unspendable</code></a> and the change policy.</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="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>>(<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><D, P, Ctx></code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#378-405" title="goto source code">[src]</a></h4><div class="docblock"><p>Choose the coin selection algorithm</p>
+<p>Overrides the <a href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html"><code>DefaultCoinSelectionAlgorithm</code></a>.</p>
+</div></div><h3 id="impl-2" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, <a class="type" href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="type bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm">DefaultCoinSelectionAlgorithm</a>, <a class="struct" href="../../../bdk/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a>></code><a href="#impl-2" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#409-414" title="goto source code">[src]</a></h3><div class="impl-items"><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/bdk/wallet/tx_builder.rs.html#411-413" 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-3" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, <a class="struct" href="../../../bdk/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a>></code><a href="#impl-3" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#417-470" 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/bdk/wallet/tx_builder.rs.html#419-422" 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/bdk/wallet/tx_builder.rs.html#425-428" title="goto source code">[src]</a></h4><div class="docblock"><p>Add a recipient to the internal list</p>
+</div><h4 id="method.set_single_recipient" class="method"><code>pub fn <a href="#method.set_single_recipient" class="fnname">set_single_recipient</a>(self, recipient: Script) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#444-449" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a single recipient that will get all the selected funds minus the fee. No change will
+be created</p>
+<p>This method overrides any recipient set with <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.set_recipients"><code>set_recipients</code></a> or
+<a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_recipient"><code>add_recipient</code></a>.</p>
+<p>It can only be used in conjunction with <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.drain_wallet"><code>drain_wallet</code></a> to send the
+entire content of the wallet (minus filters) to a single recipient or with a
+list of manually selected UTXOs by enabling <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.manually_selected_only"><code>manually_selected_only</code></a>
+and selecting them with <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.utxos"><code>utxos</code></a> or <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_utxo"><code>add_utxo</code></a>.</p>
+<p>When bumping the fees of a transaction made with this option, the user should remeber to
+add <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.maintain_single_recipient"><code>maintain_single_recipient</code></a> to correctly update the
+single output instead of adding one more for the change.</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/bdk/wallet/tx_builder.rs.html#454-457" 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/bdk/wallet/tx_builder.rs.html#466-469" 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></div><h3 id="impl-4" class="impl"><code class="in-band">impl<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>> <a class="struct" href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, <a class="type" href="../../../bdk/wallet/coin_selection/type.DefaultCoinSelectionAlgorithm.html" title="type bdk::wallet::coin_selection::DefaultCoinSelectionAlgorithm">DefaultCoinSelectionAlgorithm</a>, <a class="struct" href="../../../bdk/wallet/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a>></code><a href="#impl-4" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#473-491" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.maintain_single_recipient" class="method"><code>pub fn <a href="#method.maintain_single_recipient" class="fnname">maintain_single_recipient</a>(self) -> Self</code><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#487-490" title="goto source code">[src]</a></h4><div class="docblock"><p>Bump the fees of a transaction made with <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.set_single_recipient"><code>set_single_recipient</code></a></p>
+<p>Unless extra inputs are specified with <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_utxo"><code>add_utxo</code></a> or <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html#method.utxos"><code>utxos</code></a>, this flag will make
+<code>bump_fee</code> reduce the value of the existing output, or fail if it would be consumed
+entirely given the higher new fee rate.</p>
+<p>If extra inputs are added and they are not entirely consumed in fees, a change output will not
+be added; the existing output will simply grow in value.</p>
+<p>Fails if the transaction has more than one outputs.</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<D: <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/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, 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><D>, Ctx: <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/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</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><D, Cs, Ctx></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#74" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub 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#74" 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<D: <a class="trait" href="../../../bdk/database/trait.Database.html" title="trait bdk::database::Database">Database</a>, Cs: <a class="trait" href="../../../bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html" title="trait bdk::wallet::coin_selection::CoinSelectionAlgorithm">CoinSelectionAlgorithm</a><D>, Ctx: <a class="trait" href="../../../bdk/wallet/tx_builder/trait.TxBuilderContext.html" title="trait bdk::wallet::tx_builder::TxBuilderContext">TxBuilderContext</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><D, Cs, Ctx> <span class="where fmt-newline">where<br> Cs: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, </span></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#112-142" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub 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#117-141" 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<D, Cs, 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/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx> <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>,<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> D: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<D, Cs, 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/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx> <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>,<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br> D: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<D, Cs, 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/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx> <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>,<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> D: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<D, Cs, 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/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx> <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>,<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> 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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<D, Cs, 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/wallet/tx_builder/struct.TxBuilder.html" title="struct bdk::wallet::tx_builder::TxBuilder">TxBuilder</a><D, Cs, Ctx> <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>,<br> Ctx: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,<br> D: <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><a class="srclink" href="../../../src/bdk/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing/0.1.22/src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.22/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></p>
+</div></div><h3 id="impl-Instrument-1" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html" title="trait tracing_futures::Instrument">Instrument</a> for T</code><a href="#impl-Instrument-1" class="anchor"></a><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.22/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument">Read more</a></p>
+</div><h4 id="method.in_current_span-1" class="method hidden"><code>pub fn <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html" title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><a class="srclink" href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166-168" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a> <code>Span</code>, returning an
+<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span">Read more</a></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#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+</div></div><h3 id="impl-Pointable" class="impl"><code class="in-band">impl<T> Pointable for T</code><a href="#impl-Pointable" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedconstant.ALIGN" class="associatedconstant hidden"><code>pub const <a href="#associatedconstant.ALIGN" class="constant"><b>ALIGN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>The alignment of pointer.</p>
+</div><h4 id="associatedtype.Init" class="type"><code>type <a href="#associatedtype.Init" class="type">Init</a> = T</code></h4><div class='docblock'><p>The type for initializers.</p>
+</div><h4 id="method.init" class="method hidden"><code>pub unsafe fn <a href="#method.init" class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock hidden'><p>Initializes a with the given initializer. <a href="#tymethod.init">Read more</a></p>
+</div><h4 id="method.deref" class="method hidden"><code>pub unsafe fn <a href="#method.deref" class="fnname">deref</a><'a>(ptr: <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.reference.html">&'a </a>T</code></h4><div class='docblock hidden'><p>Dereferences the given pointer. <a href="#tymethod.deref">Read more</a></p>
+</div><h4 id="method.deref_mut" class="method hidden"><code>pub unsafe fn <a href="#method.deref_mut" class="fnname">deref_mut</a><'a>(ptr: <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.reference.html">&'a mut </a>T</code></h4><div class='docblock hidden'><p>Mutably dereferences the given pointer. <a href="#tymethod.deref_mut">Read more</a></p>
+</div><h4 id="method.drop" class="method hidden"><code>pub unsafe fn <a href="#method.drop" class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></h4><div class='docblock hidden'><p>Drops the object pointed to by the given pointer. <a href="#tymethod.drop">Read more</a></p>
+</div></div><h3 id="impl-Same%3CT%3E" class="impl"><code class="in-band">impl<T> Same<T> for T</code><a href="#impl-Same%3CT%3E" class="anchor"></a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="#associatedtype.Output" class="type">Output</a> = T</code></h4><div class='docblock'><p>Should always be <code>Self</code></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#589-598" 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>pub 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#595-597" 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#575-584" 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>pub 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#581-583" 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>pub 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 `TxBuilderContext` trait in crate `bdk`."><meta name="keywords" content="rust, rustlang, rust-lang, TxBuilderContext"><title>bdk::wallet::tx_builder::TxBuilderContext - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Trait TxBuilderContext</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">wallet</a>::<wbr><a href="index.html">tx_builder</a></p><script>window.sidebarCurrent = {name: "TxBuilderContext", 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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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" 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">tx_builder</a>::<wbr><a class="trait" href="">TxBuilderContext</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait TxBuilderContext: <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/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> { }</pre></div><div class="docblock"><p>Context in which the <a href="../../../bdk/wallet/tx_builder/struct.TxBuilder.html" title="TxBuilder"><code>TxBuilder</code></a> is valid</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-TxBuilderContext" class="impl"><code class="in-band">impl TxBuilderContext for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.BumpFee.html" title="struct bdk::wallet::tx_builder::BumpFee">BumpFee</a></code><a href="#impl-TxBuilderContext" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#67" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-TxBuilderContext-1" class="impl"><code class="in-band">impl TxBuilderContext for <a class="struct" href="../../../bdk/wallet/tx_builder/struct.CreateTx.html" title="struct bdk::wallet::tx_builder::CreateTx">CreateTx</a></code><a href="#impl-TxBuilderContext-1" class="anchor"></a><a class="srclink" href="../../../src/bdk/wallet/tx_builder.rs.html#62" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../../implementors/bdk/wallet/tx_builder/trait.TxBuilderContext.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 `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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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#77" 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 <a href="../../bdk/wallet/struct.Wallet.html" title="Wallet"><code>Wallet</code></a> that uses <a href="../../bdk/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 = "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;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{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 .item-info::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),.item-info a,#help a{color:#D2991D;}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.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>div>span{border-bottom-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;border-right:3px solid #bb7410;}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;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>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,.help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button: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
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;">
+<defs>
+ <style type="text/css"><![CDATA[
+ #logo {
+ fill-rule: nonzero;
+ }
+ #logo-teeth {
+ stroke: #000000;
+ stroke-width: 0.92px;
+ }
+ @media (prefers-color-scheme: dark) {
+ #logo {
+ fill: #FFFFFF;
+ fill-rule: nonzero;
+ }
+ #logo-teeth {
+ fill: #FFFFFF;
+ stroke: #FFFFFF;
+ stroke-width: 0.92px;
+ }
+ }
+ ]]></style>
+</defs>
+<path id="logo" d="M15.993,1.54c-7.972,0 -14.461,6.492 -14.461,14.462c0,7.969 6.492,14.461 14.461,14.461c7.97,0 14.462,-6.492 14.462,-14.461c0,-7.97 -6.492,-14.462 -14.462,-14.462Zm-0.021,1.285c0.511,0.013 0.924,0.439 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0.001 0.028,0.001Zm2.178,1.566c3.379,0.633 6.313,2.723 8.016,5.709l-1.123,2.533c-0.193,0.438 0.006,0.952 0.44,1.147l2.16,0.958c0.067,0.675 0.076,1.355 0.025,2.031l-1.202,0c-0.12,0 -0.169,0.08 -0.169,0.196l0,0.551c0,1.297 -0.731,1.582 -1.373,1.652c-0.612,0.07 -1.288,-0.257 -1.374,-0.63c-0.361,-2.029 -0.961,-2.46 -1.909,-3.21c1.178,-0.746 2.401,-1.85 2.401,-3.325c0,-1.594 -1.092,-2.597 -1.835,-3.09c-1.046,-0.688 -2.203,-0.826 -2.515,-0.826l-12.421,0c1.717,-1.918 4.02,-3.218 6.55,-3.696l1.466,1.536c0.33,0.346 0.878,0.361 1.223,0.028l1.64,-1.564Zm-13.522,7.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.951 0.951,-0.951c0.009,0 0.019,0 0.028,0Zm22.685,0.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0 0.028,0.001Zm-20.892,0.153l1.658,0l0,7.477l-3.347,0c-0.414,-1.452 -0.542,-2.97 -0.38,-4.47l2.05,-0.912c0.438,-0.195 0.637,-0.706 0.441,-1.144l-0.422,-0.951Zm6.92,0.079l3.949,0c0.205,0 1.441,0.236 1.441,1.163c0,0.768 -0.948,1.043 -1.728,1.043l-3.665,0l0.003,-2.206Zm0,5.373l3.026,0c0.275,0 1.477,0.079 1.86,1.615c0.119,0.471 0.385,2.007 0.566,2.499c0.18,0.551 0.911,1.652 1.691,1.652l4.938,0c-0.331,0.444 -0.693,0.863 -1.083,1.255l-2.01,-0.432c-0.468,-0.101 -0.93,0.199 -1.031,0.667l-0.477,2.228c-3.104,1.406 -6.672,1.389 -9.762,-0.046l-0.478,-2.228c-0.101,-0.468 -0.56,-0.767 -1.028,-0.667l-1.967,0.423c-0.365,-0.377 -0.704,-0.778 -1.016,-1.2l9.567,0c0.107,0 0.181,-0.018 0.181,-0.119l0,-3.384c0,-0.097 -0.074,-0.119 -0.181,-0.119l-2.799,0l0.003,-2.144Zm-4.415,7.749c0.512,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.952,-0.43 -0.952,-0.952c0,0 0,0 0,0c0,-0.522 0.43,-0.952 0.952,-0.952c0.009,0 0.018,0.001 0.027,0.001Zm14.089,0.043c0.511,0.015 0.924,0.439 0.923,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.009,0 0.018,0 0.028,0.001Z"/><path id="logo-teeth" d="M29.647,16.002c0,7.49 -6.163,13.653 -13.654,13.653c-7.49,0 -13.654,-6.163 -13.654,-13.653c0,-7.491 6.164,-13.654 13.654,-13.654c7.491,0 13.654,6.163 13.654,13.654Zm-0.257,-1.319l2.13,1.319l-2.13,1.318l1.83,1.71l-2.344,0.878l1.463,2.035l-2.475,0.404l1.04,2.282l-2.506,-0.089l0.575,2.442l-2.441,-0.576l0.089,2.506l-2.283,-1.04l-0.403,2.475l-2.035,-1.462l-0.878,2.343l-1.71,-1.829l-1.319,2.129l-1.318,-2.129l-1.71,1.829l-0.878,-2.343l-2.035,1.462l-0.404,-2.475l-2.282,1.04l0.089,-2.506l-2.442,0.576l0.575,-2.442l-2.505,0.089l1.04,-2.282l-2.475,-0.404l1.462,-2.035l-2.343,-0.878l1.829,-1.71l-2.129,-1.318l2.129,-1.319l-1.829,-1.71l2.343,-0.878l-1.462,-2.035l2.475,-0.404l-1.04,-2.282l2.505,0.089l-0.575,-2.441l2.442,0.575l-0.089,-2.506l2.282,1.04l0.404,-2.475l2.035,1.463l0.878,-2.344l1.71,1.83l1.318,-2.13l1.319,2.13l1.71,-1.83l0.878,2.344l2.035,-1.463l0.403,2.475l2.283,-1.04l-0.089,2.506l2.441,-0.575l-0.575,2.441l2.506,-0.089l-1.04,2.282l2.475,0.404l-1.463,2.035l2.344,0.878l-1.83,1.71Z"/></svg>
--- /dev/null
+(function() {var implementors = {};
+implementors["bdk"] = [{"text":"impl ToString for WalletExport","synthetic":false,"types":[]}];
+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"] = [];
+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 Clone for Capability","synthetic":false,"types":[]},{"text":"impl Clone for NoopProgress","synthetic":false,"types":[]},{"text":"impl Clone for LogProgress","synthetic":false,"types":[]},{"text":"impl Clone for PKOrF","synthetic":false,"types":[]},{"text":"impl Clone for SatisfiableItem","synthetic":false,"types":[]},{"text":"impl Clone for Satisfaction","synthetic":false,"types":[]},{"text":"impl Clone for Policy","synthetic":false,"types":[]},{"text":"impl Clone for Condition","synthetic":false,"types":[]},{"text":"impl Clone for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl Clone for PrivateKeyGenerateOptions","synthetic":false,"types":[]},{"text":"impl Clone for KeychainKind","synthetic":false,"types":[]},{"text":"impl Clone for FeeRate","synthetic":false,"types":[]},{"text":"impl Clone for UTXO","synthetic":false,"types":[]},{"text":"impl Clone for TransactionDetails","synthetic":false,"types":[]},{"text":"impl Clone for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl Clone for SignerId","synthetic":false,"types":[]},{"text":"impl Clone for SignerError","synthetic":false,"types":[]},{"text":"impl Clone for SignerOrdering","synthetic":false,"types":[]},{"text":"impl Clone for SignersContainer","synthetic":false,"types":[]},{"text":"impl Clone for CreateTx","synthetic":false,"types":[]},{"text":"impl Clone for BumpFee","synthetic":false,"types":[]},{"text":"impl Clone for TxOrdering","synthetic":false,"types":[]},{"text":"impl Clone for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Eq for Capability","synthetic":false,"types":[]},{"text":"impl Eq for Condition","synthetic":false,"types":[]},{"text":"impl Eq for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl Eq for KeychainKind","synthetic":false,"types":[]},{"text":"impl Eq for UTXO","synthetic":false,"types":[]},{"text":"impl Eq for TransactionDetails","synthetic":false,"types":[]},{"text":"impl Eq for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl Eq for SignerId","synthetic":false,"types":[]},{"text":"impl Eq for SignerError","synthetic":false,"types":[]},{"text":"impl Eq for SignerOrdering","synthetic":false,"types":[]},{"text":"impl Eq for TxOrdering","synthetic":false,"types":[]},{"text":"impl Eq for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Ord for Condition","synthetic":false,"types":[]},{"text":"impl Ord for SignerId","synthetic":false,"types":[]},{"text":"impl Ord for SignerOrdering","synthetic":false,"types":[]},{"text":"impl Ord for TxOrdering","synthetic":false,"types":[]},{"text":"impl Ord for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 PartialEq<Capability> for Capability","synthetic":false,"types":[]},{"text":"impl PartialEq<Condition> for Condition","synthetic":false,"types":[]},{"text":"impl PartialEq<ScriptContextEnum> for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl PartialEq<KeychainKind> for KeychainKind","synthetic":false,"types":[]},{"text":"impl PartialEq<FeeRate> for FeeRate","synthetic":false,"types":[]},{"text":"impl PartialEq<UTXO> for UTXO","synthetic":false,"types":[]},{"text":"impl PartialEq<TransactionDetails> for TransactionDetails","synthetic":false,"types":[]},{"text":"impl PartialEq<AddressValidatorError> for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl PartialEq<SignerId> for SignerId","synthetic":false,"types":[]},{"text":"impl PartialEq<SignerError> for SignerError","synthetic":false,"types":[]},{"text":"impl PartialEq<SignerOrdering> for SignerOrdering","synthetic":false,"types":[]},{"text":"impl PartialEq<TxOrdering> for TxOrdering","synthetic":false,"types":[]},{"text":"impl PartialEq<ChangeSpendPolicy> for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 PartialOrd<Condition> for Condition","synthetic":false,"types":[]},{"text":"impl PartialOrd<FeeRate> for FeeRate","synthetic":false,"types":[]},{"text":"impl PartialOrd<SignerId> for SignerId","synthetic":false,"types":[]},{"text":"impl PartialOrd<SignerOrdering> for SignerOrdering","synthetic":false,"types":[]},{"text":"impl PartialOrd<TxOrdering> for TxOrdering","synthetic":false,"types":[]},{"text":"impl PartialOrd<ChangeSpendPolicy> for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 AsRef<[u8]> for KeychainKind","synthetic":false,"types":[]}];
+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 From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<AddressValidatorError> for Error","synthetic":false,"types":[]},{"text":"impl From<PolicyError> for Error","synthetic":false,"types":[]},{"text":"impl From<SignerError> for Error","synthetic":false,"types":[]},{"text":"impl From<KeyError> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<EsploraError> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<CompactFiltersError> for Error","synthetic":false,"types":[]},{"text":"impl From<ElectrumBlockchain> for AnyBlockchain","synthetic":false,"types":[]},{"text":"impl From<EsploraBlockchain> for AnyBlockchain","synthetic":false,"types":[]},{"text":"impl From<CompactFiltersBlockchain> for AnyBlockchain","synthetic":false,"types":[]},{"text":"impl From<ElectrumBlockchainConfig> for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl From<EsploraBlockchainConfig> for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl From<CompactFiltersBlockchainConfig> for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl From<Client> for ElectrumBlockchain","synthetic":false,"types":[]},{"text":"impl From<Error> for EsploraError","synthetic":false,"types":[]},{"text":"impl From<ParseIntError> for EsploraError","synthetic":false,"types":[]},{"text":"impl From<Error> for EsploraError","synthetic":false,"types":[]},{"text":"impl From<Error> for EsploraError","synthetic":false,"types":[]},{"text":"impl From<Error> for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl From<Error> for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl From<Error> for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl From<SystemTimeError> for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl From<Error> for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl From<MemoryDatabase> for AnyDatabase","synthetic":false,"types":[]},{"text":"impl From<Tree> for AnyDatabase","synthetic":false,"types":[]},{"text":"impl From<<MemoryDatabase as BatchDatabase>::Batch> for AnyBatch","synthetic":false,"types":[]},{"text":"impl From<<Tree as BatchDatabase>::Batch> for AnyBatch","synthetic":false,"types":[]},{"text":"impl From<()> for AnyDatabaseConfig","synthetic":false,"types":[]},{"text":"impl From<SledDbConfiguration> for AnyDatabaseConfig","synthetic":false,"types":[]},{"text":"impl From<KeyError> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<Error> for Error","synthetic":false,"types":[]},{"text":"impl From<PolicyError> for Error","synthetic":false,"types":[]},{"text":"impl From<bool> for Satisfaction","synthetic":false,"types":[]},{"text":"impl From<SatisfiableItem> for Policy","synthetic":false,"types":[]},{"text":"impl From<Error> for KeyError","synthetic":false,"types":[]},{"text":"impl From<Error> for KeyError","synthetic":false,"types":[]},{"text":"impl From<Hash> for SignerId","synthetic":false,"types":[]},{"text":"impl From<Fingerprint> for SignerId","synthetic":false,"types":[]},{"text":"impl From<HashMap<DescriptorPublicKey, DescriptorSecretKey, RandomState>> for SignersContainer","synthetic":false,"types":[]}];
+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 Default for Mempool","synthetic":false,"types":[]},{"text":"impl Default for MemoryDatabase","synthetic":false,"types":[]},{"text":"impl Default for PKOrF","synthetic":false,"types":[]},{"text":"impl Default for Condition","synthetic":false,"types":[]},{"text":"impl Default for PrivateKeyGenerateOptions","synthetic":false,"types":[]},{"text":"impl Default for FeeRate","synthetic":false,"types":[]},{"text":"impl Default for TransactionDetails","synthetic":false,"types":[]},{"text":"impl Default for LargestFirstCoinSelection","synthetic":false,"types":[]},{"text":"impl Default for BranchAndBoundCoinSelection","synthetic":false,"types":[]},{"text":"impl Default for SignerOrdering","synthetic":false,"types":[]},{"text":"impl Default for SignersContainer","synthetic":false,"types":[]},{"text":"impl Default for CreateTx","synthetic":false,"types":[]},{"text":"impl Default for BumpFee","synthetic":false,"types":[]},{"text":"impl<D: Database, Cs: CoinSelectionAlgorithm<D>, Ctx: TxBuilderContext> Default for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: Default, </span>","synthetic":false,"types":[]},{"text":"impl Default for TxOrdering","synthetic":false,"types":[]},{"text":"impl Default for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Debug for Error","synthetic":false,"types":[]},{"text":"impl Debug for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Debug for ElectrumBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Debug for EsploraBlockchain","synthetic":false,"types":[]},{"text":"impl Debug for EsploraBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Debug for EsploraError","synthetic":false,"types":[]},{"text":"impl Debug for Mempool","synthetic":false,"types":[]},{"text":"impl Debug for Peer","synthetic":false,"types":[]},{"text":"impl Debug for CompactFiltersBlockchain","synthetic":false,"types":[]},{"text":"impl Debug for BitcoinPeerConfig","synthetic":false,"types":[]},{"text":"impl Debug for CompactFiltersBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Debug for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl Debug for Capability","synthetic":false,"types":[]},{"text":"impl Debug for AnyDatabase","synthetic":false,"types":[]},{"text":"impl Debug for SledDbConfiguration","synthetic":false,"types":[]},{"text":"impl Debug for AnyDatabaseConfig","synthetic":false,"types":[]},{"text":"impl Debug for MemoryDatabase","synthetic":false,"types":[]},{"text":"impl Debug for Error","synthetic":false,"types":[]},{"text":"impl Debug for PKOrF","synthetic":false,"types":[]},{"text":"impl Debug for SatisfiableItem","synthetic":false,"types":[]},{"text":"impl Debug for Satisfaction","synthetic":false,"types":[]},{"text":"impl Debug for Policy","synthetic":false,"types":[]},{"text":"impl Debug for Condition","synthetic":false,"types":[]},{"text":"impl Debug for PolicyError","synthetic":false,"types":[]},{"text":"impl<Ctx: Debug + ScriptContext> Debug for DescriptorKey<Ctx>","synthetic":false,"types":[]},{"text":"impl Debug for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl Debug for PrivateKeyGenerateOptions","synthetic":false,"types":[]},{"text":"impl Debug for KeyError","synthetic":false,"types":[]},{"text":"impl Debug for KeychainKind","synthetic":false,"types":[]},{"text":"impl Debug for FeeRate","synthetic":false,"types":[]},{"text":"impl Debug for UTXO","synthetic":false,"types":[]},{"text":"impl Debug for TransactionDetails","synthetic":false,"types":[]},{"text":"impl Debug for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl Debug for CoinSelectionResult","synthetic":false,"types":[]},{"text":"impl Debug for LargestFirstCoinSelection","synthetic":false,"types":[]},{"text":"impl Debug for BranchAndBoundCoinSelection","synthetic":false,"types":[]},{"text":"impl Debug for WalletExport","synthetic":false,"types":[]},{"text":"impl Debug for SignerId","synthetic":false,"types":[]},{"text":"impl Debug for SignerError","synthetic":false,"types":[]},{"text":"impl Debug for SignerOrdering","synthetic":false,"types":[]},{"text":"impl Debug for SignersContainer","synthetic":false,"types":[]},{"text":"impl Debug for CreateTx","synthetic":false,"types":[]},{"text":"impl Debug for BumpFee","synthetic":false,"types":[]},{"text":"impl<D: Debug + Database, Cs: Debug + CoinSelectionAlgorithm<D>, Ctx: Debug + TxBuilderContext> Debug for TxBuilder<D, Cs, Ctx>","synthetic":false,"types":[]},{"text":"impl Debug for TxOrdering","synthetic":false,"types":[]},{"text":"impl Debug for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Display for Error","synthetic":false,"types":[]},{"text":"impl Display for EsploraError","synthetic":false,"types":[]},{"text":"impl Display for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl Display for Error","synthetic":false,"types":[]},{"text":"impl Display for PolicyError","synthetic":false,"types":[]},{"text":"impl Display for KeyError","synthetic":false,"types":[]},{"text":"impl Display for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl Display for SignerError","synthetic":false,"types":[]}];
+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 Hash for Capability","synthetic":false,"types":[]},{"text":"impl Hash for Condition","synthetic":false,"types":[]},{"text":"impl Hash for KeychainKind","synthetic":false,"types":[]},{"text":"impl Hash for SignerId","synthetic":false,"types":[]},{"text":"impl Hash for TxOrdering","synthetic":false,"types":[]},{"text":"impl Hash for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Copy for Capability","synthetic":false,"types":[]},{"text":"impl Copy for Condition","synthetic":false,"types":[]},{"text":"impl Copy for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl Copy for PrivateKeyGenerateOptions","synthetic":false,"types":[]},{"text":"impl Copy for KeychainKind","synthetic":false,"types":[]},{"text":"impl Copy for FeeRate","synthetic":false,"types":[]},{"text":"impl Copy for TxOrdering","synthetic":false,"types":[]},{"text":"impl Copy for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Error","synthetic":true,"types":[]},{"text":"impl !Freeze for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl Freeze for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !Freeze for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl Freeze for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Freeze for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl Freeze for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Freeze for EsploraError","synthetic":true,"types":[]},{"text":"impl !Freeze for Mempool","synthetic":true,"types":[]},{"text":"impl Freeze for Peer","synthetic":true,"types":[]},{"text":"impl Freeze for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl Freeze for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl Freeze for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Freeze for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl Freeze for Capability","synthetic":true,"types":[]},{"text":"impl Freeze for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl Freeze for NoopProgress","synthetic":true,"types":[]},{"text":"impl Freeze for LogProgress","synthetic":true,"types":[]},{"text":"impl Freeze for AnyDatabase","synthetic":true,"types":[]},{"text":"impl Freeze for AnyBatch","synthetic":true,"types":[]},{"text":"impl Freeze for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl Freeze for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl Freeze for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl Freeze for Error","synthetic":true,"types":[]},{"text":"impl Freeze for PKOrF","synthetic":true,"types":[]},{"text":"impl Freeze for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl Freeze for Satisfaction","synthetic":true,"types":[]},{"text":"impl Freeze for Policy","synthetic":true,"types":[]},{"text":"impl Freeze for Condition","synthetic":true,"types":[]},{"text":"impl Freeze for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> Freeze for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP44<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP49<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP84<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<K> Freeze for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> Freeze for DescriptorKey<Ctx>","synthetic":true,"types":[]},{"text":"impl Freeze for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> Freeze for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> K: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl Freeze for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl Freeze for KeyError","synthetic":true,"types":[]},{"text":"impl Freeze for KeychainKind","synthetic":true,"types":[]},{"text":"impl Freeze for FeeRate","synthetic":true,"types":[]},{"text":"impl Freeze for UTXO","synthetic":true,"types":[]},{"text":"impl Freeze for TransactionDetails","synthetic":true,"types":[]},{"text":"impl Freeze for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl Freeze for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl Freeze for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl Freeze for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl Freeze for WalletExport","synthetic":true,"types":[]},{"text":"impl Freeze for SignerId","synthetic":true,"types":[]},{"text":"impl Freeze for SignerError","synthetic":true,"types":[]},{"text":"impl Freeze for SignerOrdering","synthetic":true,"types":[]},{"text":"impl Freeze for SignersContainer","synthetic":true,"types":[]},{"text":"impl Freeze for CreateTx","synthetic":true,"types":[]},{"text":"impl Freeze for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> Freeze for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: Freeze, </span>","synthetic":true,"types":[]},{"text":"impl Freeze for TxOrdering","synthetic":true,"types":[]},{"text":"impl Freeze for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> !Freeze for Wallet<B, D>","synthetic":true,"types":[]}];
+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 Send for Error","synthetic":true,"types":[]},{"text":"impl Send for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl Send for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Send for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl Send for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Send for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl Send for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Send for EsploraError","synthetic":true,"types":[]},{"text":"impl Send for Mempool","synthetic":true,"types":[]},{"text":"impl Send for Peer","synthetic":true,"types":[]},{"text":"impl Send for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl Send for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl Send for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Send for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl Send for Capability","synthetic":true,"types":[]},{"text":"impl Send for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl Send for NoopProgress","synthetic":true,"types":[]},{"text":"impl Send for LogProgress","synthetic":true,"types":[]},{"text":"impl !Send for AnyDatabase","synthetic":true,"types":[]},{"text":"impl !Send for AnyBatch","synthetic":true,"types":[]},{"text":"impl Send for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl Send for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl !Send for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl Send for Error","synthetic":true,"types":[]},{"text":"impl Send for PKOrF","synthetic":true,"types":[]},{"text":"impl Send for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl Send for Satisfaction","synthetic":true,"types":[]},{"text":"impl Send for Policy","synthetic":true,"types":[]},{"text":"impl Send for Condition","synthetic":true,"types":[]},{"text":"impl Send for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> Send for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP44<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP49<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP84<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<K> Send for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> Send for DescriptorKey<Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Send, </span>","synthetic":true,"types":[]},{"text":"impl Send for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> Send for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Send,<br> K: Send, </span>","synthetic":true,"types":[]},{"text":"impl Send for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl Send for KeyError","synthetic":true,"types":[]},{"text":"impl Send for KeychainKind","synthetic":true,"types":[]},{"text":"impl Send for FeeRate","synthetic":true,"types":[]},{"text":"impl Send for UTXO","synthetic":true,"types":[]},{"text":"impl Send for TransactionDetails","synthetic":true,"types":[]},{"text":"impl Send for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl Send for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl Send for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl Send for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl Send for WalletExport","synthetic":true,"types":[]},{"text":"impl Send for SignerId","synthetic":true,"types":[]},{"text":"impl Send for SignerError","synthetic":true,"types":[]},{"text":"impl Send for SignerOrdering","synthetic":true,"types":[]},{"text":"impl Send for SignersContainer","synthetic":true,"types":[]},{"text":"impl Send for CreateTx","synthetic":true,"types":[]},{"text":"impl Send for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> Send for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: Send,<br> Ctx: Send,<br> D: Send, </span>","synthetic":true,"types":[]},{"text":"impl Send for TxOrdering","synthetic":true,"types":[]},{"text":"impl Send for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> Send for Wallet<B, D> <span class=\"where fmt-newline\">where<br> B: Send,<br> D: Send, </span>","synthetic":true,"types":[]}];
+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 StructuralEq for Capability","synthetic":false,"types":[]},{"text":"impl StructuralEq for Condition","synthetic":false,"types":[]},{"text":"impl StructuralEq for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl StructuralEq for KeychainKind","synthetic":false,"types":[]},{"text":"impl StructuralEq for UTXO","synthetic":false,"types":[]},{"text":"impl StructuralEq for TransactionDetails","synthetic":false,"types":[]},{"text":"impl StructuralEq for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl StructuralEq for SignerId","synthetic":false,"types":[]},{"text":"impl StructuralEq for SignerError","synthetic":false,"types":[]},{"text":"impl StructuralEq for SignerOrdering","synthetic":false,"types":[]},{"text":"impl StructuralEq for TxOrdering","synthetic":false,"types":[]},{"text":"impl StructuralEq for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 StructuralPartialEq for Capability","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for Condition","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for ScriptContextEnum","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for KeychainKind","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for FeeRate","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for UTXO","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for TransactionDetails","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for SignerId","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for SignerError","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for SignerOrdering","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for TxOrdering","synthetic":false,"types":[]},{"text":"impl StructuralPartialEq for ChangeSpendPolicy","synthetic":false,"types":[]}];
+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 Sync for Error","synthetic":true,"types":[]},{"text":"impl Sync for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl Sync for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Sync for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl Sync for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Sync for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl Sync for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Sync for EsploraError","synthetic":true,"types":[]},{"text":"impl Sync for Mempool","synthetic":true,"types":[]},{"text":"impl Sync for Peer","synthetic":true,"types":[]},{"text":"impl Sync for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl Sync for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl Sync for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Sync for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl Sync for Capability","synthetic":true,"types":[]},{"text":"impl Sync for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl Sync for NoopProgress","synthetic":true,"types":[]},{"text":"impl Sync for LogProgress","synthetic":true,"types":[]},{"text":"impl !Sync for AnyDatabase","synthetic":true,"types":[]},{"text":"impl !Sync for AnyBatch","synthetic":true,"types":[]},{"text":"impl Sync for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl Sync for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl !Sync for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl Sync for Error","synthetic":true,"types":[]},{"text":"impl Sync for PKOrF","synthetic":true,"types":[]},{"text":"impl Sync for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl Sync for Satisfaction","synthetic":true,"types":[]},{"text":"impl Sync for Policy","synthetic":true,"types":[]},{"text":"impl Sync for Condition","synthetic":true,"types":[]},{"text":"impl Sync for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> Sync for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP44<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP49<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP84<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<K> Sync for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> Sync for DescriptorKey<Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Sync, </span>","synthetic":true,"types":[]},{"text":"impl Sync for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> Sync for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Sync,<br> K: Sync, </span>","synthetic":true,"types":[]},{"text":"impl Sync for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl Sync for KeyError","synthetic":true,"types":[]},{"text":"impl Sync for KeychainKind","synthetic":true,"types":[]},{"text":"impl Sync for FeeRate","synthetic":true,"types":[]},{"text":"impl Sync for UTXO","synthetic":true,"types":[]},{"text":"impl Sync for TransactionDetails","synthetic":true,"types":[]},{"text":"impl Sync for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl Sync for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl Sync for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl Sync for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl Sync for WalletExport","synthetic":true,"types":[]},{"text":"impl Sync for SignerId","synthetic":true,"types":[]},{"text":"impl Sync for SignerError","synthetic":true,"types":[]},{"text":"impl Sync for SignerOrdering","synthetic":true,"types":[]},{"text":"impl Sync for SignersContainer","synthetic":true,"types":[]},{"text":"impl Sync for CreateTx","synthetic":true,"types":[]},{"text":"impl Sync for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> Sync for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: Sync,<br> Ctx: Sync,<br> D: Sync, </span>","synthetic":true,"types":[]},{"text":"impl Sync for TxOrdering","synthetic":true,"types":[]},{"text":"impl Sync for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> !Sync for Wallet<B, D>","synthetic":true,"types":[]}];
+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 Unpin for Error","synthetic":true,"types":[]},{"text":"impl Unpin for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl Unpin for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Unpin for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl Unpin for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Unpin for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl Unpin for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Unpin for EsploraError","synthetic":true,"types":[]},{"text":"impl Unpin for Mempool","synthetic":true,"types":[]},{"text":"impl Unpin for Peer","synthetic":true,"types":[]},{"text":"impl Unpin for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl Unpin for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl Unpin for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl Unpin for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl Unpin for Capability","synthetic":true,"types":[]},{"text":"impl Unpin for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl Unpin for NoopProgress","synthetic":true,"types":[]},{"text":"impl Unpin for LogProgress","synthetic":true,"types":[]},{"text":"impl Unpin for AnyDatabase","synthetic":true,"types":[]},{"text":"impl Unpin for AnyBatch","synthetic":true,"types":[]},{"text":"impl Unpin for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl Unpin for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl Unpin for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl Unpin for Error","synthetic":true,"types":[]},{"text":"impl Unpin for PKOrF","synthetic":true,"types":[]},{"text":"impl Unpin for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl Unpin for Satisfaction","synthetic":true,"types":[]},{"text":"impl Unpin for Policy","synthetic":true,"types":[]},{"text":"impl Unpin for Condition","synthetic":true,"types":[]},{"text":"impl Unpin for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> Unpin for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP44<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP49<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP84<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<K> Unpin for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> Unpin for DescriptorKey<Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl Unpin for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> Unpin for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> Ctx: Unpin,<br> K: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl Unpin for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl Unpin for KeyError","synthetic":true,"types":[]},{"text":"impl Unpin for KeychainKind","synthetic":true,"types":[]},{"text":"impl Unpin for FeeRate","synthetic":true,"types":[]},{"text":"impl Unpin for UTXO","synthetic":true,"types":[]},{"text":"impl Unpin for TransactionDetails","synthetic":true,"types":[]},{"text":"impl Unpin for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl Unpin for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl Unpin for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl Unpin for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl Unpin for WalletExport","synthetic":true,"types":[]},{"text":"impl Unpin for SignerId","synthetic":true,"types":[]},{"text":"impl Unpin for SignerError","synthetic":true,"types":[]},{"text":"impl Unpin for SignerOrdering","synthetic":true,"types":[]},{"text":"impl Unpin for SignersContainer","synthetic":true,"types":[]},{"text":"impl Unpin for CreateTx","synthetic":true,"types":[]},{"text":"impl Unpin for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> Unpin for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: Unpin,<br> Ctx: Unpin,<br> D: Unpin, </span>","synthetic":true,"types":[]},{"text":"impl Unpin for TxOrdering","synthetic":true,"types":[]},{"text":"impl Unpin for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> Unpin for Wallet<B, D> <span class=\"where fmt-newline\">where<br> B: Unpin,<br> D: Unpin, </span>","synthetic":true,"types":[]}];
+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<K, Ctx: ScriptContext> Deref for GeneratedKey<K, Ctx>","synthetic":false,"types":[]}];
+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 FromStr for WalletExport","synthetic":false,"types":[]}];
+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> Deserialize<'de> for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for ElectrumBlockchainConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for EsploraBlockchainConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for BitcoinPeerConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for CompactFiltersBlockchainConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for SledDbConfiguration","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for AnyDatabaseConfig","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for KeychainKind","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for UTXO","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for TransactionDetails","synthetic":false,"types":[]},{"text":"impl<'de> Deserialize<'de> for WalletExport","synthetic":false,"types":[]}];
+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 Serialize for AnyBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Serialize for ElectrumBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Serialize for EsploraBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Serialize for BitcoinPeerConfig","synthetic":false,"types":[]},{"text":"impl Serialize for CompactFiltersBlockchainConfig","synthetic":false,"types":[]},{"text":"impl Serialize for SledDbConfiguration","synthetic":false,"types":[]},{"text":"impl Serialize for AnyDatabaseConfig","synthetic":false,"types":[]},{"text":"impl Serialize for PKOrF","synthetic":false,"types":[]},{"text":"impl Serialize for SatisfiableItem","synthetic":false,"types":[]},{"text":"impl Serialize for Satisfaction","synthetic":false,"types":[]},{"text":"impl Serialize for Policy","synthetic":false,"types":[]},{"text":"impl Serialize for Condition","synthetic":false,"types":[]},{"text":"impl Serialize for KeychainKind","synthetic":false,"types":[]},{"text":"impl Serialize for UTXO","synthetic":false,"types":[]},{"text":"impl Serialize for TransactionDetails","synthetic":false,"types":[]},{"text":"impl Serialize for WalletExport","synthetic":false,"types":[]}];
+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 Error for Error","synthetic":false,"types":[]},{"text":"impl Error for EsploraError","synthetic":false,"types":[]},{"text":"impl Error for CompactFiltersError","synthetic":false,"types":[]},{"text":"impl Error for Error","synthetic":false,"types":[]},{"text":"impl Error for PolicyError","synthetic":false,"types":[]},{"text":"impl Error for KeyError","synthetic":false,"types":[]},{"text":"impl Error for AddressValidatorError","synthetic":false,"types":[]},{"text":"impl Error for SignerError","synthetic":false,"types":[]}];
+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 !RefUnwindSafe for Error","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for EsploraError","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Mempool","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for Peer","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Capability","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for NoopProgress","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for LogProgress","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for AnyDatabase","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for AnyBatch","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Error","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for PKOrF","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Satisfaction","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Policy","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for Condition","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP44<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP49<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP84<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> RefUnwindSafe for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> RefUnwindSafe for DescriptorKey<Ctx> <span class=\"where fmt-newline\">where<br> Ctx: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> RefUnwindSafe for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> Ctx: RefUnwindSafe,<br> K: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for KeyError","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for KeychainKind","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for FeeRate","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for UTXO","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for TransactionDetails","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for WalletExport","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for SignerId","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for SignerError","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for SignerOrdering","synthetic":true,"types":[]},{"text":"impl !RefUnwindSafe for SignersContainer","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for CreateTx","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> RefUnwindSafe for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: RefUnwindSafe,<br> Ctx: RefUnwindSafe,<br> D: RefUnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for TxOrdering","synthetic":true,"types":[]},{"text":"impl RefUnwindSafe for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> !RefUnwindSafe for Wallet<B, D>","synthetic":true,"types":[]}];
+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 !UnwindSafe for Error","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for AnyBlockchain","synthetic":true,"types":[]},{"text":"impl UnwindSafe for AnyBlockchainConfig","synthetic":true,"types":[]},{"text":"impl UnwindSafe for ElectrumBlockchain","synthetic":true,"types":[]},{"text":"impl UnwindSafe for ElectrumBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for EsploraBlockchain","synthetic":true,"types":[]},{"text":"impl UnwindSafe for EsploraBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for EsploraError","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Mempool","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for Peer","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for CompactFiltersBlockchain","synthetic":true,"types":[]},{"text":"impl UnwindSafe for BitcoinPeerConfig","synthetic":true,"types":[]},{"text":"impl UnwindSafe for CompactFiltersBlockchainConfig","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for CompactFiltersError","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Capability","synthetic":true,"types":[]},{"text":"impl UnwindSafe for OfflineBlockchain","synthetic":true,"types":[]},{"text":"impl UnwindSafe for NoopProgress","synthetic":true,"types":[]},{"text":"impl UnwindSafe for LogProgress","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for AnyDatabase","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for AnyBatch","synthetic":true,"types":[]},{"text":"impl UnwindSafe for SledDbConfiguration","synthetic":true,"types":[]},{"text":"impl UnwindSafe for AnyDatabaseConfig","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for MemoryDatabase","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Error","synthetic":true,"types":[]},{"text":"impl UnwindSafe for PKOrF","synthetic":true,"types":[]},{"text":"impl UnwindSafe for SatisfiableItem","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Satisfaction","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Policy","synthetic":true,"types":[]},{"text":"impl UnwindSafe for Condition","synthetic":true,"types":[]},{"text":"impl UnwindSafe for PolicyError","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for P2PKH<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for P2WPKH_P2SH<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for P2WPKH<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP44<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP44Public<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP49<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP49Public<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP84<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<K> UnwindSafe for BIP84Public<K> <span class=\"where fmt-newline\">where<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl<Ctx> UnwindSafe for DescriptorKey<Ctx> <span class=\"where fmt-newline\">where<br> Ctx: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl UnwindSafe for ScriptContextEnum","synthetic":true,"types":[]},{"text":"impl<K, Ctx> UnwindSafe for GeneratedKey<K, Ctx> <span class=\"where fmt-newline\">where<br> Ctx: UnwindSafe,<br> K: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl UnwindSafe for PrivateKeyGenerateOptions","synthetic":true,"types":[]},{"text":"impl UnwindSafe for KeyError","synthetic":true,"types":[]},{"text":"impl UnwindSafe for KeychainKind","synthetic":true,"types":[]},{"text":"impl UnwindSafe for FeeRate","synthetic":true,"types":[]},{"text":"impl UnwindSafe for UTXO","synthetic":true,"types":[]},{"text":"impl UnwindSafe for TransactionDetails","synthetic":true,"types":[]},{"text":"impl UnwindSafe for AddressValidatorError","synthetic":true,"types":[]},{"text":"impl UnwindSafe for CoinSelectionResult","synthetic":true,"types":[]},{"text":"impl UnwindSafe for LargestFirstCoinSelection","synthetic":true,"types":[]},{"text":"impl UnwindSafe for BranchAndBoundCoinSelection","synthetic":true,"types":[]},{"text":"impl UnwindSafe for WalletExport","synthetic":true,"types":[]},{"text":"impl UnwindSafe for SignerId","synthetic":true,"types":[]},{"text":"impl UnwindSafe for SignerError","synthetic":true,"types":[]},{"text":"impl UnwindSafe for SignerOrdering","synthetic":true,"types":[]},{"text":"impl !UnwindSafe for SignersContainer","synthetic":true,"types":[]},{"text":"impl UnwindSafe for CreateTx","synthetic":true,"types":[]},{"text":"impl UnwindSafe for BumpFee","synthetic":true,"types":[]},{"text":"impl<D, Cs, Ctx> UnwindSafe for TxBuilder<D, Cs, Ctx> <span class=\"where fmt-newline\">where<br> Cs: UnwindSafe,<br> Ctx: UnwindSafe,<br> D: UnwindSafe, </span>","synthetic":true,"types":[]},{"text":"impl UnwindSafe for TxOrdering","synthetic":true,"types":[]},{"text":"impl UnwindSafe for ChangeSpendPolicy","synthetic":true,"types":[]},{"text":"impl<B, D> !UnwindSafe for Wallet<B, D>","synthetic":true,"types":[]}];
+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;}.logo-container.rust-logo>img{}::-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 .item-info::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),.item-info a,#help a{color:#3873AD;}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.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;}#help>div>span{border-bottom-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;border-right:3px solid #ffb44c;}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;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>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,.help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button: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 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 getSearchInput(){return document.getElementsByClassName("search-input")[0]}function getSearchElement(){return document.getElementById("search")}function getThemesElement(){return document.getElementById("theme-choices")}function getThemePickerElement(){return document.getElementById("theme-picker")}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=getSettingValue("disable-shortcuts")==="true";var search_input=getSearchInput();var searchTimeout=null;var toggleAllDocsId="toggle-all-docs";var currentTab=0;var mouseMovedAfterSearch=true;var titleBeforeSearch=document.title;var searchTitle=null;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)}}}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=""}function showSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(main,"hidden");removeClass(search,"hidden");mouseMovedAfterSearch=false;document.title=searchTitle}function hideSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(search,"hidden");removeClass(main,"hidden");document.title=titleBeforeSearch}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 getHelpElement(){buildHelperPopup();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)}defocusSearchBar();hideThemeButtonState()}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"?":displayHelp(true,ev);break;case"t":case"T":displayHelp(false,ev);ev.preventDefault();var themePicker=getThemePickerElement();themePicker.click();themePicker.focus();break;default:var themePicker=getThemePickerElement();if(themePicker.parentNode.contains(ev.target)){handleThemeKeyDown(ev)}}}}function handleThemeKeyDown(ev){var active=document.activeElement;var themes=getThemesElement();switch(getVirtualKey(ev)){case"ArrowUp":ev.preventDefault();if(active.previousElementSibling&&ev.target.id!=="theme-picker"){active.previousElementSibling.focus()}else{showThemeButtonState();themes.lastElementChild.focus()}break;case"ArrowDown":ev.preventDefault();if(active.nextElementSibling&&ev.target.id!=="theme-picker"){active.nextElementSibling.focus()}else{showThemeButtonState();themes.firstElementChild.focus()}break;case"Enter":case"Return":case"Space":if(ev.target.id==="theme-picker"&&themes.style.display==="none"){ev.preventDefault();showThemeButtonState();themes.firstElementChild.focus()}break;case"Home":ev.preventDefault();themes.firstElementChild.focus();break;case"End":ev.preventDefault();themes.lastElementChild.focus();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,"help-button")){displayHelp(true,ev)}else 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(h_e){actives[current].push(h_e)});current+=1});if(e.which===38){if(e.ctrlKey){printTab(currentTab>0?currentTab-1:2)}else{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(e.ctrlKey){printTab(currentTab>1?0:currentTab+1)}else 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===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\">"+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"<button class=\"selected\">"+text+" <div class=\"count\">("+nbElems+")</div></button>"}return"<button>"+text+" <div class=\"count\">("+nbElems+")</div></button>"}function showResults(results){var search=getSearchElement();if(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==getSearchLoadingText())){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click();return}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>";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}searchTitle="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=convertHTMLToPlaintext(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)}}};function convertHTMLToPlaintext(html){var x=document.createElement("div");x.innerHTML=html.replace('<code>','`').replace('</code>','`');return x.innerText}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(toggleAllDocsId);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 shouldHide=fullHide===true||hasClass(n,"method")===true||hasClass(n,"associatedconstant")===true;if(shouldHide===true||hasClass(n,"type")===true){if(shouldHide===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,"item-info"))){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,"item-info")){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){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");if(hasClass(docblock,"item-info")===false){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");if(hasClass(docblock,"item-info")===false){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(getSettingValue("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)})}}}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 toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}var toggle=createSimpleToggle(false);var hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";var hideImplementors=getSettingValue("auto-collapse-implementors")!=="false";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"item-info")){next=next.nextElementSibling}if(!next){return}if(hasClass(next,"docblock")){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,"item-info")){next=next.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)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideImplementors===true&&e.parentNode.id==="implementors-list"){collapseDocs(newToggle,"hide",pageId)}}};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=getSettingValue("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=getSettingValue("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,getSettingValue("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(getSettingValue("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(getSettingValue("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)})}());onEachLazy(document.getElementsByClassName("notable-traits"),function(e){e.onclick=function(){this.getElementsByClassName('notable-traits-tooltiptext')[0].classList.toggle("force-tooltip")}});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))}document.title=searchTitle}}function getSearchLoadingText(){return"Loading search results..."}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;\">"+getSearchLoadingText()+"</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()}}}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"}}})}function enableSearchInput(){if(search_input){search_input.removeAttribute('disabled')}}window.addSearchOptions=function(crates){var elem=document.getElementById("crate-search");if(!elem){enableSearchInput();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=getSettingValue("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}}enableSearchInput()};function buildHelperPopup(){var popup=document.createElement("aside");addClass(popup,"hidden");popup.id="help";var book_info=document.createElement("span");book_info.innerHTML="You can find more information in \
+ <a href=\"https://doc.rust-lang.org/rustdoc/\">the rustdoc book</a>.";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["T","Focus the theme picker menu"],["↑","Move up in search results"],["↓","Move down in search results"],["ctrl + ↑ / ↓","Switch result tab"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"<dt>"+x[0].split(" ").map((y,index)=>(index&1)===0?"<kbd>"+y+"</kbd>":y).join("")+"</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 item kind.","Accepted kinds 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(book_info);container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,getSearchElement());buildHelperPopup=function(){}}onHashChange(null);window.onhashchange=onHashChange}());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;}#main .impl-items .hidden{display:block !important;}
\ 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(.notable),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 td:first-child>a,.collapse-toggle,div.item-list .out-of-band,#source-sidebar,#sidebar-toggle{font-family:"Fira Sans",sans-serif;}.content ul.crate a.crate{font:16px/1.6 "Fira Sans";}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,.docblock code.spotlight{padding:0;}.docblock code.spotlight :last-child{padding-bottom:0.6em;}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;margin-bottom:40px;}.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{overflow-wrap:anywhere;}.docblock-short p{display:inline;}.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:not(.notable-traits){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 .item-info code{font-size:90%;}.content .item-info{position:relative;margin-left:33px;margin-top:-13px;}.sub-variant>div>.item-info{margin-top:initial;}.content .item-info::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 .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.item-info{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,.item-info a{text-decoration:underline;}.invisible>.srclink,h4>code+.srclink,h3>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% - 63px);}#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>div>span{text-align:center;display:block;margin:10px 0;font-size:18px;border-bottom:1px solid #ccc;padding-bottom:4px;margin-bottom:6px;}#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:0 20px 20px 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,.methods .since{flex-grow:0;padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{flex-grow:0;font-size:17px;font-weight:normal;}.impl-items code,.impl code,.methods code{flex-grow:1;}.impl-items h4,h4.impl,h3.impl,.methods h3{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 .tooltiptext::after{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;}.tooltip:hover .tooltiptext{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:20px;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:16px;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:20px;}pre.rust.rust-example-rendered{position:relative;}pre.rust{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>button{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border:0;border-top:2px solid;}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:16px;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}h4>.notable-traits{position:absolute;left:-44px;top:2px;}#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,.help-button{position:absolute;top:10px;}#settings-menu{right:0;outline:none;}.help-button{right:30px;font-family:"Fira Sans",sans-serif;text-align:center;font-size:17px;}#theme-picker,#settings-menu,.help-button{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 8px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}@media (min-width:701px){.information:first-child>.tooltip{margin-top:16px;}}@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;}h4>.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>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;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}.help-button{display:none;}.search-container>div{width:calc(100% - 32px);}}@media print{nav.sub,.content .out-of-band,.collapse-toggle{display:none;}}@media (max-width:416px){#titles,#titles>button{height:73px;}#main{margin-top:100px;}#main>table:not(.table-display) td{word-break:break-word;width:50%;}.search-container>div{display:block;width:calc(100% - 37px);}#crate-search{width:100%;border-radius:4px;border:0;}#crate-search+.search-input{width:calc(100% + 71px);margin-left:-36px;}#theme-picker,#settings-menu{padding:5px;width:31px;height:31px;}#theme-picker{margin-top:-2px;}#settings-menu{top:7px;}}h3.notable{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":"A modern, lightweight, descriptor-based wallet library …","i":[[0,"blockchain","bdk","Blockchain backends",null,null],[0,"any","bdk::blockchain","Runtime-checked blockchain types",null,null],[4,"AnyBlockchain","bdk::blockchain::any","Type that can contain any of the [<code>Blockchain</code>] types …",null,null],[13,"Electrum","","Electrum client",0,null],[13,"Esplora","","Esplora client",0,null],[13,"CompactFilters","","Compact filters client",0,null],[4,"AnyBlockchainConfig","","Type that can contain any of the blockchain …",null,null],[13,"Electrum","","Electrum client",1,null],[13,"Esplora","","Esplora client",1,null],[13,"CompactFilters","","Compact filters client",1,null],[0,"electrum","bdk::blockchain","Electrum",null,null],[3,"ElectrumBlockchain","bdk::blockchain::electrum","Wrapper over an Electrum Client that implements the …",null,null],[3,"ElectrumBlockchainConfig","","Configuration for an [<code>ElectrumBlockchain</code>]",null,null],[12,"url","","URL of the Electrum server (such as ElectrumX, Esplora, …",2,null],[12,"socks5","","URL of the socks5 proxy server or a Tor service",2,null],[12,"retry","","Request retry count",2,null],[12,"timeout","","Request timeout (seconds)",2,null],[0,"esplora","bdk::blockchain","Esplora",null,null],[3,"EsploraBlockchain","bdk::blockchain::esplora","Structure that implements the logic to sync with Esplora",null,null],[11,"new","","Create a new instance of the client from a base URL",3,[[["option",4]]]],[3,"EsploraBlockchainConfig","","Configuration for an [<code>EsploraBlockchain</code>]",null,null],[12,"base_url","","Base URL of the esplora service",4,null],[12,"concurrency","","Number of parallel requests sent to the esplora service …",4,null],[4,"EsploraError","","Errors that can happen during a sync with […",null,null],[13,"Reqwest","","Error with the HTTP call",5,null],[13,"Parsing","","Invalid number returned",5,null],[13,"BitcoinEncoding","","Invalid Bitcoin data returned",5,null],[13,"Hex","","Invalid Hex data returned",5,null],[13,"TransactionNotFound","","Transaction not found",5,null],[13,"HeaderHeightNotFound","","Header height not found",5,null],[13,"HeaderHashNotFound","","Header hash not found",5,null],[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],[11,"new","","Construct a new instance given a list of peers, a path to …",6,[[["peer",3],["asref",8],["option",4],["vec",3],["path",3]],[["compactfilterserror",4],["result",4]]]],[3,"BitcoinPeerConfig","","Data to connect to a Bitcoin P2P peer",null,null],[12,"address","","Peer address such as 127.0.0.1:18333",7,null],[12,"socks5","","Optional socks5 proxy",7,null],[12,"socks5_credentials","","Optional socks5 proxy credentials",7,null],[3,"CompactFiltersBlockchainConfig","","Configuration for a [<code>CompactFiltersBlockchain</code>]",null,null],[12,"peers","","List of peers to try to connect to for asking headers and …",8,null],[12,"network","","Network used",8,null],[12,"storage_dir","","Storage dir to save partially downloaded headers and full …",8,null],[12,"skip_blocks","","Optionally skip initial <code>skip_blocks</code> blocks (default: 0)",8,null],[4,"CompactFiltersError","","An error that can occur during sync with a […",null,null],[13,"InvalidResponse","","A peer sent an invalid or unexpected response",9,null],[13,"InvalidHeaders","","The headers returned are invalid",9,null],[13,"InvalidFilterHeader","","The compact filter headers returned are invalid",9,null],[13,"InvalidFilter","","The compact filter returned is invalid",9,null],[13,"MissingBlock","","The peer is missing a block in the valid chain",9,null],[13,"DataCorruption","","The data stored in the block filters storage are corrupted",9,null],[13,"NotConnected","","A peer is not connected",9,null],[13,"Timeout","","A peer took too long to reply to one of our messages",9,null],[13,"NoPeers","","No peers have been specified",9,null],[13,"DB","","Internal database error",9,null],[13,"IO","","Internal I/O error",9,null],[13,"BIP158","","Invalid BIP158 filter",9,null],[13,"Time","","Internal system time error",9,null],[13,"Global","","Wrapper for [<code>crate::error::Error</code>]",9,null],[4,"Capability","bdk::blockchain","Capabilities that can be supported by a [<code>Blockchain</code>] …",null,null],[13,"FullHistory","","Can recover the full history of a wallet and not only the …",10,null],[13,"GetAnyTx","","Can fetch any historical transaction given its txid",10,null],[13,"AccurateFees","","Can compute accurate fees for the transactions found …",10,null],[8,"BlockchainMarker","","Marker trait for a blockchain backend",null,null],[3,"OfflineBlockchain","","Type that only implements [<code>BlockchainMarker</code>] and is …",null,null],[8,"Blockchain","","Trait that defines the actions that must be supported by …",null,null],[10,"get_capabilities","","Return the set of [<code>Capability</code>] supported by this backend",11,[[],[["hashset",3],["capability",4]]]],[10,"setup","","Setup the backend and populate the internal database for …",11,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"sync","","Populate the internal database with transactions and UTXOs",11,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[10,"get_tx","","Fetch a transaction from the blockchain given its txid",11,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[10,"broadcast","","Broadcast a transaction",11,[[["transaction",3]],[["error",4],["result",4]]]],[10,"get_height","","Return the current height",11,[[],[["result",4],["error",4]]]],[10,"estimate_fee","","Estimate the fee rate required to confirm a transaction …",11,[[],[["feerate",3],["error",4],["result",4]]]],[8,"ConfigurableBlockchain","","Trait for [<code>Blockchain</code>] types that can be created given a …",null,null],[16,"Config","","Type that contains the configuration",12,null],[10,"from_config","","Create a new instance given a configuration",12,[[],[["result",4],["error",4]]]],[6,"ProgressData","","Data sent with a progress update over a [<code>channel</code>]",null,null],[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]],[["error",4],["result",4]]]],[5,"progress","","Shortcut to create a [<code>channel</code>] (pair of [<code>Sender</code>] and […",null,[[]]],[3,"NoopProgress","","Type that implements [<code>Progress</code>] and drops every update …",null,null],[5,"noop_progress","","Create a new instance of [<code>NoopProgress</code>]",null,[[],["noopprogress",3]]],[3,"LogProgress","","Type that implements [<code>Progress</code>] and logs at level <code>INFO</code> …",null,null],[5,"log_progress","","Create a nwe instance of [<code>LogProgress</code>]",null,[[],["logprogress",3]]],[0,"database","bdk","Database types",null,null],[0,"any","bdk::database","Runtime-checked database types",null,null],[4,"AnyDatabase","bdk::database::any","Type that can contain any of the [<code>Database</code>] types defined …",null,null],[13,"Memory","","In-memory ephemeral database",14,null],[13,"Sled","","Simple key-value embedded database based on [<code>sled</code>]",14,null],[4,"AnyBatch","","Type that contains any of the [<code>BatchDatabase::Batch</code>] …",null,null],[13,"Memory","","In-memory ephemeral database",15,null],[13,"Sled","","Simple key-value embedded database based on [<code>sled</code>]",15,null],[3,"SledDbConfiguration","","Configuration type for a [<code>sled::Tree</code>] database",null,null],[12,"path","","Main directory of the db",16,null],[12,"tree_name","","Name of the database tree, a separated namespace for the …",16,null],[4,"AnyDatabaseConfig","","Type that can contain any of the database configurations …",null,null],[13,"Memory","","Memory database has no config",17,null],[13,"Sled","","Simple key-value embedded database based on [<code>sled</code>]",17,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",18,[[]]],[8,"BatchOperations","bdk::database","Trait for operations that can be batched",null,null],[10,"set_script_pubkey","","Store a script_pubkey along with its keychain and child …",19,[[["script",3],["keychainkind",4]],[["error",4],["result",4]]]],[10,"set_utxo","","Store a [<code>UTXO</code>]",19,[[["utxo",3]],[["error",4],["result",4]]]],[10,"set_raw_tx","","Store a raw transaction",19,[[["transaction",3]],[["error",4],["result",4]]]],[10,"set_tx","","Store the metadata of a transaction",19,[[["transactiondetails",3]],[["error",4],["result",4]]]],[10,"set_last_index","","Store the last derivation index for a given keychain.",19,[[["keychainkind",4]],[["error",4],["result",4]]]],[10,"del_script_pubkey_from_path","","Delete a script_pubkey given the keychain and its child …",19,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[10,"del_path_from_script_pubkey","","Delete the data related to a specific script_pubkey, …",19,[[["script",3]],[["error",4],["result",4],["option",4]]]],[10,"del_utxo","","Delete a [<code>UTXO</code>] given its [<code>OutPoint</code>]",19,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[10,"del_raw_tx","","Delete a raw transaction given its [<code>Txid</code>]",19,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[10,"del_tx","","Delete the metadata of a transaction and optionally the …",19,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"del_last_index","","Delete the last derivation index for a keychain.",19,[[["keychainkind",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 …",20,[[["asref",8],["keychainkind",4]],[["error",4],["result",4]]]],[10,"iter_script_pubkeys","","Return the list of script_pubkeys",20,[[["option",4],["keychainkind",4]],[["vec",3],["result",4],["error",4]]]],[10,"iter_utxos","","Return the list of [<code>UTXO</code>]s",20,[[],[["result",4],["vec",3],["error",4]]]],[10,"iter_raw_txs","","Return the list of raw transactions",20,[[],[["vec",3],["result",4],["error",4]]]],[10,"iter_txs","","Return the list of transactions metadata",20,[[],[["error",4],["result",4],["vec",3]]]],[10,"get_script_pubkey_from_path","","Fetch a script_pubkey given the child number of a …",20,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[10,"get_path_from_script_pubkey","","Fetch the keychain and child number of a given …",20,[[["script",3]],[["error",4],["result",4],["option",4]]]],[10,"get_utxo","","Fetch a [<code>UTXO</code>] given its [<code>OutPoint</code>]",20,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[10,"get_raw_tx","","Fetch a raw transaction given its [<code>Txid</code>]",20,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[10,"get_tx","","Fetch the transaction metadata and optionally also the …",20,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[10,"get_last_index","","Return the last defivation index for a keychain.",20,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[10,"increment_last_index","","Increment the last derivation index for a keychain and …",20,[[["keychainkind",4]],[["result",4],["error",4]]]],[8,"BatchDatabase","","Trait for a database that supports batch operations",null,null],[16,"Batch","","Container for the operations",21,null],[10,"begin_batch","","Create a new batch container",21,[[]]],[10,"commit_batch","","Consume and apply a batch of operations",21,[[],[["error",4],["result",4]]]],[8,"ConfigurableDatabase","","Trait for [<code>Database</code>] types that can be created given a …",null,null],[16,"Config","","Type that contains the configuration",22,null],[10,"from_config","","Create a new instance given a configuration",22,[[],[["result",4],["error",4]]]],[0,"descriptor","bdk","Descriptors",null,null],[6,"KeyMap","bdk::descriptor","Alias type for a map of public key to secret key",null,null],[4,"Descriptor","","Script descriptor",null,null],[13,"Bare","","A raw scriptpubkey (including pay-to-pubkey) under Legacy …",23,null],[13,"Pk","","Pay-to-Pubkey",23,null],[13,"Pkh","","Pay-to-PubKey-Hash",23,null],[13,"Wpkh","","Pay-to-Witness-PubKey-Hash",23,null],[13,"ShWpkh","","Pay-to-Witness-PubKey-Hash inside P2SH",23,null],[13,"Sh","","Pay-to-ScriptHash with Legacy context",23,null],[13,"Wsh","","Pay-to-Witness-ScriptHash with Segwitv0 context",23,null],[13,"ShWsh","","P2SH-P2WSH with Segwitv0 context",23,null],[13,"ShSortedMulti","","Sortedmulti under P2SH",23,null],[13,"WshSortedMulti","","Sortedmulti under P2WSH",23,null],[13,"ShWshSortedMulti","","Sortedmulti under P2SH-P2WSH",23,null],[4,"Legacy","","Legacy ScriptContext To be used as P2SH scripts For …",null,null],[3,"Miniscript","","Top-level script AST type",null,null],[12,"node","","A node in the Abstract Syntax Tree(",24,null],[12,"ty","","The correctness and malleability type information for the …",24,null],[12,"ext","","Additional information helpful for extra analysis.",24,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 …",25,[[]]],[16,"Hash","","The associated Hash type with the publicKey",25,null],[10,"to_pubkeyhash","","Converts an object to PublicHash",25,[[]]],[8,"ScriptContext","","The ScriptContext for Miniscript. Additional type …",null,null],[10,"check_terminal_non_malleable","","Depending on ScriptContext, fragments can be malleable. …",26,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_witness","","Check whether the given satisfaction is valid under the …",26,[[],[["scriptcontexterror",4],["result",4]]]],[10,"max_satisfaction_size","","Depending on script context, the size of a satifaction …",26,[[["miniscript",3]],["option",4]]],[11,"check_global_consensus_validity","","Depending on script Context, some of the Terminals might …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_policy_validity","","Depending on script Context, some of the script resource …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_consensus_validity","","Consensus rules at the Miniscript satisfaction time. It …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_policy_validity","","Policy rules at the Miniscript satisfaction time. It is …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_validity","","Check the consensus + policy(if not disabled) rules that …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_validity","","Check the consensus + policy(if not disabled) rules …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"top_level_type_check","","Check whether the top-level is type B",26,[[["miniscript",3]],[["error",4],["result",4]]]],[11,"other_top_level_checks","","Other top level checks that are context specific",26,[[["miniscript",3]],[["error",4],["result",4]]]],[11,"top_level_checks","","Check top level consensus rules.",26,[[["miniscript",3]],[["error",4],["result",4]]]],[4,"Segwitv0","","Segwitv0 ScriptContext",null,null],[4,"Terminal","","All AST elements",null,null],[13,"True","","<code>1</code>",27,null],[13,"False","","<code>0</code>",27,null],[13,"PkK","","<code><key></code>",27,null],[13,"PkH","","<code>DUP HASH160 <keyhash> EQUALVERIFY</code>",27,null],[13,"After","","<code>n CHECKLOCKTIMEVERIFY</code>",27,null],[13,"Older","","<code>n CHECKSEQUENCEVERIFY</code>",27,null],[13,"Sha256","","<code>SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL</code>",27,null],[13,"Hash256","","<code>SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL</code>",27,null],[13,"Ripemd160","","<code>SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL</code>",27,null],[13,"Hash160","","<code>SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL</code>",27,null],[13,"Alt","","<code>TOALTSTACK [E] FROMALTSTACK</code>",27,null],[13,"Swap","","<code>SWAP [E1]</code>",27,null],[13,"Check","","<code>[Kt]/[Ke] CHECKSIG</code>",27,null],[13,"DupIf","","<code>DUP IF [V] ENDIF</code>",27,null],[13,"Verify","","[T] VERIFY",27,null],[13,"NonZero","","SIZE 0NOTEQUAL IF [Fn] ENDIF",27,null],[13,"ZeroNotEqual","","[X] 0NOTEQUAL",27,null],[13,"AndV","","[V] [T]/[V]/[F]/[Kt]",27,null],[13,"AndB","","[E] [W] BOOLAND",27,null],[13,"AndOr","","[various] NOTIF [various] ELSE [various] ENDIF",27,null],[13,"OrB","","[E] [W] BOOLOR",27,null],[13,"OrD","","[E] IFDUP NOTIF [T]/[E] ENDIF",27,null],[13,"OrC","","[E] NOTIF [V] ENDIF",27,null],[13,"OrI","","IF [various] ELSE [various] ENDIF",27,null],[13,"Thresh","","[E] ([W] ADD)* k EQUAL",27,null],[13,"Multi","","k ()* n CHECKMULTISIG",27,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 C represents …",28,[[],["publickey",3]]],[11,"serialized_len","","Computes the size of a public key when serialized in a …",28,[[]]],[10,"hash_to_hash160","","Converts a hashed version of the public key to a <code>hash160</code> …",28,[[],["hash",3]]],[0,"checksum","","Descriptor checksum",null,null],[5,"get_checksum","bdk::descriptor::checksum","Compute the checksum of a descriptor",null,[[],[["result",4],["string",3],["error",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,"InvalidHDKeyPath","","Invalid HD Key path, such as having a wildcard but a …",29,null],[13,"Key","","Error thrown while working with <code>keys</code>",29,null],[13,"Policy","","Error while extracting and manipulating policies",29,null],[13,"InvalidDescriptorCharacter","","Invalid character found in the descriptor checksum",29,null],[13,"BIP32","","BIP32 error",29,null],[13,"Base58","","Error during base58 decoding",29,null],[13,"PK","","Key-related error",29,null],[13,"Miniscript","","Miniscript error",29,null],[13,"Hex","","Hex decoding error",29,null],[0,"policy","bdk::descriptor","Descriptor policy",null,null],[3,"PKOrF","bdk::descriptor::policy","Raw public key or extended key fingerprint",null,null],[4,"SatisfiableItem","","An item that needs to be satisfied",null,null],[13,"Signature","","Signature for a raw public key",30,null],[13,"SignatureKey","","Signature for an extended key fingerprint",30,null],[13,"SHA256Preimage","","SHA256 preimage hash",30,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","The digest value",31,null],[13,"HASH256Preimage","bdk::descriptor::policy","Double SHA256 preimage hash",30,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","The digest value",32,null],[13,"RIPEMD160Preimage","bdk::descriptor::policy","RIPEMD160 preimage hash",30,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","The digest value",33,null],[13,"HASH160Preimage","bdk::descriptor::policy","SHA256 then RIPEMD160 preimage hash",30,null],[12,"hash","bdk::descriptor::policy::SatisfiableItem","The digest value",34,null],[13,"AbsoluteTimelock","bdk::descriptor::policy","Absolute timeclock timestamp",30,null],[12,"value","bdk::descriptor::policy::SatisfiableItem","The timestamp value",35,null],[13,"RelativeTimelock","bdk::descriptor::policy","Relative timelock locktime",30,null],[12,"value","bdk::descriptor::policy::SatisfiableItem","The locktime value",36,null],[13,"Multisig","bdk::descriptor::policy","Multi-signature public keys with threshold count",30,null],[12,"keys","bdk::descriptor::policy::SatisfiableItem","The raw public key or extended key fingerprint",37,null],[12,"threshold","","The required threshold count",37,null],[13,"Thresh","bdk::descriptor::policy","Threshold items with threshold count",30,null],[12,"items","bdk::descriptor::policy::SatisfiableItem","The policy items",38,null],[12,"threshold","","The required threshold count",38,null],[11,"is_leaf","bdk::descriptor::policy","Returns whether the [<code>SatisfiableItem</code>] is a leaf item",30,[[]]],[11,"id","","Returns a unique id for the [<code>SatisfiableItem</code>]",30,[[],["string",3]]],[6,"ConditionMap","","Type for a map of sets of [<code>Condition</code>] items keyed by each …",null,null],[6,"FoldedConditionMap","","Type for a map of folded sets of [<code>Condition</code>] items keyed …",null,null],[4,"Satisfaction","","Represent if and how much a policy item is satisfied by …",null,null],[13,"Partial","","Only a partial satisfaction of some kind of threshold …",39,null],[12,"n","bdk::descriptor::policy::Satisfaction","Total number of items",40,null],[12,"m","","Threshold",40,null],[12,"items","","The items that can be satisfied by the descriptor",40,null],[12,"sorted","","Whether the items are sorted in lexicographic order (used …",40,null],[12,"conditions","","Extra conditions that also need to be satisfied",40,null],[13,"PartialComplete","bdk::descriptor::policy","Can reach the threshold of some kind of threshold policy",39,null],[12,"n","bdk::descriptor::policy::Satisfaction","Total number of items",41,null],[12,"m","","Threshold",41,null],[12,"items","","The items that can be satisfied by the descriptor",41,null],[12,"sorted","","Whether the items are sorted in lexicographic order (used …",41,null],[12,"conditions","","Extra conditions that also need to be satisfied",41,null],[13,"Complete","bdk::descriptor::policy","Can satisfy the policy item",39,null],[12,"condition","bdk::descriptor::policy::Satisfaction","Extra conditions that also need to be satisfied",42,null],[13,"None","bdk::descriptor::policy","Cannot satisfy or contribute to the policy item",39,null],[11,"is_leaf","","Returns whether the [<code>Satisfaction</code>] is a leaf item",39,[[]]],[3,"Policy","","Descriptor spending policy",null,null],[12,"id","","Identifier for this policy node",43,null],[12,"item","","Type of this policy node",43,null],[12,"satisfaction","","How a much given PSBT already satisfies this polcy node <strong>…",43,null],[12,"contribution","","How the wallet\'s descriptor can satisfy this policy node",43,null],[3,"Condition","","An extra condition that must be satisfied but that is out …",null,null],[12,"csv","","Optional CheckSequenceVerify condition",44,null],[12,"timelock","","Optional timelock condition",44,null],[11,"is_null","","Returns <code>true</code> if there are no extra conditions to verify",44,[[]]],[4,"PolicyError","","Errors that can happen while extracting and manipulating …",null,null],[13,"NotEnoughItemsSelected","","Not enough items are selected to satisfy a […",45,null],[13,"TooManyItemsSelected","","Too many items are selected to satisfy a […",45,null],[13,"IndexOutOfRange","","Index out of range for an item to satisfy a […",45,null],[13,"AddOnLeaf","","Can not add to an item that is [<code>Satisfaction::None</code>] or […",45,null],[13,"AddOnPartialComplete","","Can not add to an item that is […",45,null],[13,"MixedTimelockUnits","","Can not merge CSV or timelock values unless both are less …",45,null],[13,"IncompatibleConditions","","Incompatible conditions (not currently used)",45,null],[11,"requires_path","","Return whether or not a specific path in the policy tree …",43,[[]]],[11,"get_condition","","Return the conditions that are set by the spending policy …",43,[[["btreemap",3]],[["condition",3],["result",4],["policyerror",4]]]],[0,"template","bdk::descriptor","Descriptor templates",null,null],[6,"DescriptorTemplateOut","bdk::descriptor::template","Type alias for the return type of [<code>DescriptorTemplate</code>], …",null,null],[8,"DescriptorTemplate","","Trait for descriptor templates that can be built into a …",null,null],[10,"build","","Build the complete descriptor",46,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[3,"P2PKH","","P2PKH template. Expands to a descriptor <code>pkh(key)</code>",null,null],[12,"0","","",47,null],[3,"P2WPKH_P2SH","","P2WPKH-P2SH template. Expands to a descriptor …",null,null],[12,"0","","",48,null],[3,"P2WPKH","","P2WPKH template. Expands to a descriptor <code>wpkh(key)</code>",null,null],[12,"0","","",49,null],[3,"BIP44","","BIP44 template. Expands to <code>pkh(key/44\'/0\'/0\'/{0,1}/*)</code>",null,null],[12,"0","","",50,null],[12,"1","","",50,null],[3,"BIP44Public","","BIP44 public template. Expands to <code>pkh(key/{0,1}/*)</code>",null,null],[12,"0","","",51,null],[12,"1","","",51,null],[12,"2","","",51,null],[3,"BIP49","","BIP49 template. Expands to <code>sh(wpkh(key/49\'/0\'/0\'/{0,1}/*))</code>",null,null],[12,"0","","",52,null],[12,"1","","",52,null],[3,"BIP49Public","","BIP49 public template. Expands to <code>sh(wpkh(key/{0,1}/*))</code>",null,null],[12,"0","","",53,null],[12,"1","","",53,null],[12,"2","","",53,null],[3,"BIP84","","BIP84 template. Expands to <code>wpkh(key/84\'/0\'/0\'/{0,1}/*)</code>",null,null],[12,"0","","",54,null],[12,"1","","",54,null],[3,"BIP84Public","","BIP84 public template. Expands to <code>wpkh(key/{0,1}/*)</code>",null,null],[12,"0","","",55,null],[12,"1","","",55,null],[12,"2","","",55,null],[6,"ExtendedDescriptor","bdk::descriptor","Alias for a [<code>Descriptor</code>] that can contain extended keys …",null,null],[6,"HDKeyPaths","","Alias for the type of maps that represent derivation …",null,null],[8,"ToWalletDescriptor","","Trait for types which can be converted into an […",null,null],[10,"to_wallet_descriptor","","Convert to wallet descriptor",56,[[["network",4]],[["result",4],["keyerror",4]]]],[8,"ExtractPolicy","","Trait implemented on [<code>Descriptor</code>]s to add a method to …",null,null],[10,"extract_policy","","Extract the spending [<code>policy</code>]",57,[[["signerscontainer",3],["secp256k1",3]],[["result",4],["error",4],["option",4]]]],[0,"keys","bdk","Key formats",null,null],[4,"DescriptorPublicKey","bdk::keys","The MiniscriptKey corresponding to Descriptors. This can …",null,null],[13,"SinglePub","","Single Public Key",58,null],[13,"XPub","","Xpub",58,null],[4,"DescriptorSecretKey","","A Secret Key that can be either a single key or an Xprv",null,null],[13,"SinglePriv","","Single Secret Key",59,null],[13,"XPrv","","Xprv",59,null],[3,"DescriptorSinglePriv","","A Single Descriptor Secret Key with optional origin …",null,null],[12,"origin","","Origin information",60,null],[12,"key","","The key",60,null],[3,"DescriptorSinglePub","","A Single Descriptor Key with optional origin information",null,null],[12,"origin","","Origin information",61,null],[12,"key","","The key",61,null],[3,"SortedMultiVec","","Contents of a \\\"sortedmulti\\\" descriptor",null,null],[12,"k","","signatures required",62,null],[12,"pks","","public keys inside sorted Multi",62,null],[8,"ScriptContext","","The ScriptContext for Miniscript. Additional type …",null,null],[10,"check_terminal_non_malleable","","Depending on ScriptContext, fragments can be malleable. …",26,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_witness","","Check whether the given satisfaction is valid under the …",26,[[],[["scriptcontexterror",4],["result",4]]]],[10,"max_satisfaction_size","","Depending on script context, the size of a satifaction …",26,[[["miniscript",3]],["option",4]]],[11,"check_global_consensus_validity","","Depending on script Context, some of the Terminals might …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_policy_validity","","Depending on script Context, some of the script resource …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_consensus_validity","","Consensus rules at the Miniscript satisfaction time. It …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_policy_validity","","Policy rules at the Miniscript satisfaction time. It is …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_validity","","Check the consensus + policy(if not disabled) rules that …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_validity","","Check the consensus + policy(if not disabled) rules …",26,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"top_level_type_check","","Check whether the top-level is type B",26,[[["miniscript",3]],[["error",4],["result",4]]]],[11,"other_top_level_checks","","Other top level checks that are context specific",26,[[["miniscript",3]],[["error",4],["result",4]]]],[11,"top_level_checks","","Check top level consensus rules.",26,[[["miniscript",3]],[["error",4],["result",4]]]],[0,"bip39","","BIP-0039",null,null],[6,"MnemonicWithPassphrase","bdk::keys::bip39","Type for a BIP39 mnemonic with an optional passphrase",null,null],[6,"ValidNetworks","bdk::keys","Set of valid networks for a key",null,null],[5,"any_network","","Create a set containing mainnet, testnet and regtest",null,[[],["validnetworks",6]]],[5,"mainnet_network","","Create a set only containing mainnet",null,[[],["validnetworks",6]]],[5,"test_networks","","Create a set containing testnet and regtest",null,[[],["validnetworks",6]]],[5,"merge_networks","","Compute the intersection of two sets",null,[[["validnetworks",6]],["validnetworks",6]]],[4,"DescriptorKey","","Container for public or secret keys",null,null],[11,"from_public","","Create an instance given a public key and a set of valid …",63,[[["descriptorpublickey",4],["validnetworks",6]]]],[11,"from_secret","","Create an instance given a secret key and a set of valid …",63,[[["descriptorsecretkey",4],["validnetworks",6]]]],[11,"override_valid_networks","","Override the computed set of valid networks",63,[[["validnetworks",6]]]],[4,"ScriptContextEnum","","Enum representation of the known valid [<code>ScriptContext</code>]s",null,null],[13,"Legacy","","Legacy scripts",64,null],[13,"Segwitv0","","Segwitv0 scripts",64,null],[11,"is_legacy","","Returns whether the script context is […",64,[[]]],[11,"is_segwit_v0","","Returns whether the script context is […",64,[[]]],[8,"ExtScriptContext","","Trait that adds extra useful methods to [<code>ScriptContext</code>]s",null,null],[10,"as_enum","","Returns the [<code>ScriptContext</code>] as a [<code>ScriptContextEnum</code>]",65,[[],["scriptcontextenum",4]]],[11,"is_legacy","","Returns whether the script context is <code>Legacy</code>",65,[[]]],[11,"is_segwit_v0","","Returns whether the script context is <code>Segwitv0</code>",65,[[]]],[8,"ToDescriptorKey","","Trait for objects that can be turned into a public or …",null,null],[10,"to_descriptor_key","","Turn the key into a [<code>DescriptorKey</code>] within the requested […",66,[[],[["result",4],["descriptorkey",4],["keyerror",4]]]],[8,"DerivableKey","","Trait for keys that can be derived.",null,null],[10,"add_metadata","","Add a extra metadata, consume <code>self</code> and turn it into a […",67,[[["keysource",6],["derivationpath",3],["option",4]],[["result",4],["descriptorkey",4],["keyerror",4]]]],[3,"GeneratedKey","","Output of a [<code>GeneratableKey</code>] key generation",null,null],[11,"into_key","","Consumes <code>self</code> and returns the key",68,[[]]],[8,"GeneratableKey","","Trait for keys that can be generated",null,null],[16,"Entropy","","Type specifying the amount of entropy required e.g. [u8;32…",69,null],[16,"Options","","Extra options required by the <code>generate_with_entropy</code>",69,null],[16,"Error","","Returned error in case of failure",69,null],[10,"generate_with_entropy","","Generate a key given the extra options and the entropy",69,[[],[["result",4],["generatedkey",3]]]],[11,"generate","","Generate a key given the options with a random entropy",69,[[],[["result",4],["generatedkey",3]]]],[8,"GeneratableDefaultOptions","","Trait that allows generating a key with the default …",null,null],[11,"generate_with_entropy_default","","Generate a key with the default options and a given …",70,[[],[["result",4],["generatedkey",3]]]],[11,"generate_default","","Generate a key with the default options and a random …",70,[[],[["result",4],["generatedkey",3]]]],[3,"PrivateKeyGenerateOptions","","Options for generating a [<code>PrivateKey</code>]",null,null],[12,"compressed","","Whether the generated key should be \\\"compressed\\\" or not",71,null],[4,"KeyError","","Errors thrown while working with <code>keys</code>",null,null],[13,"InvalidScriptContext","","The key cannot exist in the given script context",72,null],[13,"InvalidNetwork","","The key is not valid for the given network",72,null],[13,"InvalidChecksum","","The key has an invalid checksum",72,null],[13,"Message","","Custom error message",72,null],[13,"BIP32","","BIP32 error",72,null],[13,"Miniscript","","Miniscript error",72,null],[0,"wallet","bdk","Wallet",null,null],[0,"address_validator","bdk::wallet","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","","User rejected the address",73,null],[13,"ConnectionError","","Network connection error",73,null],[13,"TimeoutError","","Network request timeout error",73,null],[13,"InvalidScript","","Invalid script",73,null],[13,"Message","","A custom error message",73,null],[8,"AddressValidator","","Trait to build address validators",null,null],[10,"validate","","Validate or inspect an address",74,[[["script",3],["hdkeypaths",6],["keychainkind",4]],[["addressvalidatorerror",4],["result",4]]]],[0,"coin_selection","bdk::wallet","Coin selection",null,null],[6,"DefaultCoinSelectionAlgorithm","bdk::wallet::coin_selection","Default coin selection algorithm used by <code>TxBuilder</code> if not …",null,null],[3,"CoinSelectionResult","","Result of a successful coin selection",null,null],[12,"selected","","List of outputs selected for use as inputs",75,null],[12,"selected_amount","","Sum of the selected inputs\' value",75,null],[12,"fee_amount","","Total fee amount in satoshi",75,null],[8,"CoinSelectionAlgorithm","","Trait for generalized coin selection algorithms",null,null],[10,"coin_select","","Perform the coin selection",76,[[["feerate",3],["vec",3]],[["result",4],["error",4],["coinselectionresult",3]]]],[3,"LargestFirstCoinSelection","","Simple and dumb coin selection",null,null],[3,"BranchAndBoundCoinSelection","","Branch and bound coin selection",null,null],[11,"new","","Create new instance with target size for change output",77,[[]]],[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 …",78,null],[12,"label","","Arbitrary label for the wallet",78,null],[11,"export_wallet","","Export a wallet",78,[[["wallet",3]],["result",4]]],[11,"descriptor","","Return the external descriptor",78,[[],["string",3]]],[11,"change_descriptor","","Return the internal descriptor, if present",78,[[],[["string",3],["option",4]]]],[0,"signer","bdk::wallet","Generalized signers",null,null],[4,"SignerId","bdk::wallet::signer","Identifier of a signer in the <code>SignersContainers</code>. Used as …",null,null],[13,"PkHash","","Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA …",79,null],[13,"Fingerprint","","The fingerprint of a BIP32 extended key",79,null],[4,"SignerError","","Signing error",null,null],[13,"MissingKey","","The private key is missing for the required public key",80,null],[13,"InvalidKey","","The private key in use has the right fingerprint but …",80,null],[13,"UserCanceled","","The user canceled the operation",80,null],[13,"InputIndexOutOfRange","","Input index is out of range",80,null],[13,"MissingNonWitnessUtxo","","The <code>non_witness_utxo</code> field of the transaction is required …",80,null],[13,"InvalidNonWitnessUtxo","","The <code>non_witness_utxo</code> specified is invalid",80,null],[13,"MissingWitnessUtxo","","The <code>witness_utxo</code> field of the transaction is required to …",80,null],[13,"MissingWitnessScript","","The <code>witness_script</code> field of the transaction is requied to …",80,null],[13,"MissingHDKeypath","","The fingerprint and derivation path are missing from the …",80,null],[8,"Signer","","Trait for signers",null,null],[10,"sign","","Sign a PSBT",81,[[["secp256k1",3],["partiallysignedtransaction",3],["option",4]],[["signererror",4],["result",4]]]],[10,"sign_whole_tx","","Return whether or not the signer signs the whole …",81,[[]]],[11,"descriptor_secret_key","","Return the secret key for the signer",81,[[],[["option",4],["descriptorsecretkey",4]]]],[3,"SignerOrdering","","Defines the order in which signers are called",null,null],[12,"0","","",82,null],[3,"SignersContainer","","Container for multiple signers",null,null],[11,"as_key_map","","Create a map of public keys to secret keys",83,[[["secp256k1",3]],["keymap",6]]],[11,"new","","Default constructor",83,[[]]],[11,"add_external","","Adds an external signer to the container for the …",83,[[["signer",8],["arc",3],["signerordering",3],["signerid",4]],[["arc",3],["option",4]]]],[11,"remove","","Removes a signer from the container and returns it",83,[[["signerordering",3],["signerid",4]],[["arc",3],["option",4]]]],[11,"ids","","Returns the list of identifiers of all the signers in the …",83,[[],[["signerid",4],["vec",3]]]],[11,"signers","","Returns the list of signers in the container, sorted by …",83,[[],[["vec",3],["arc",3]]]],[11,"find","","Finds the signer with lowest ordering for a given id in …",83,[[["signerid",4]],[["option",4],["arc",3]]]],[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],[8,"TxBuilderContext","bdk::wallet::tx_builder","Context in which the [<code>TxBuilder</code>] is valid",null,null],[3,"CreateTx","","<code>Wallet::create_tx</code> context",null,null],[3,"BumpFee","","<code>Wallet::bump_fee</code> context",null,null],[3,"TxBuilder","","A transaction builder",null,null],[11,"new","","Create an empty builder",84,[[]]],[11,"fee_rate","","Set a custom fee rate",84,[[["feerate",3]]]],[11,"fee_absolute","","Set an absolute fee",84,[[]]],[11,"policy_path","","Set the policy path to use while creating the transaction …",84,[[["string",3],["btreemap",3],["vec",3],["keychainkind",4]]]],[11,"utxos","","Replace the internal list of utxos that <strong>must</strong> be spent …",84,[[["vec",3],["outpoint",3]]]],[11,"add_utxo","","Add a utxo to the internal list of utxos that <strong>must</strong> be …",84,[[["outpoint",3]]]],[11,"manually_selected_only","","Only spend utxos added by <code>add_utxo</code> and <code>utxos</code>.",84,[[]]],[11,"unspendable","","Replace the internal list of unspendable utxos with a new …",84,[[["vec",3],["outpoint",3]]]],[11,"add_unspendable","","Add a utxo to the internal list of unspendable utxos",84,[[["outpoint",3]]]],[11,"sighash","","Sign with a specific sig hash",84,[[["sighashtype",4]]]],[11,"ordering","","Choose the ordering for inputs and outputs of the …",84,[[["txordering",4]]]],[11,"nlocktime","","Use a specific nLockTime while creating the transaction",84,[[]]],[11,"version","","Build a transaction with a specific version",84,[[]]],[11,"do_not_spend_change","","Do not spend change outputs",84,[[]]],[11,"only_spend_change","","Only spend change outputs",84,[[]]],[11,"change_policy","","Set a specific [<code>ChangeSpendPolicy</code>]. See […",84,[[["changespendpolicy",4]]]],[11,"force_non_witness_utxo","","Fill-in the <code>psbt::Input::non_witness_utxo</code> field even if …",84,[[]]],[11,"include_output_redeem_witness_script","","Fill-in the <code>psbt::Output::redeem_script</code> and …",84,[[]]],[11,"add_global_xpubs","","Fill-in the <code>PSBT_GLOBAL_XPUB</code> field with the extended keys …",84,[[]]],[11,"drain_wallet","","Spend all the available inputs. This respects filters …",84,[[]]],[11,"coin_selection","","Choose the coin selection algorithm",84,[[["coinselectionalgorithm",8]],[["coinselectionalgorithm",8],["txbuilder",3]]]],[11,"with_recipients","","Create a builder starting from a list of recipients",84,[[["vec",3]]]],[11,"set_recipients","","Replace the recipients already added with a new list",84,[[["vec",3]]]],[11,"add_recipient","","Add a recipient to the internal list",84,[[["script",3]]]],[11,"set_single_recipient","","Set a single recipient that will get all the selected …",84,[[["script",3]]]],[11,"enable_rbf","","Enable signaling RBF",84,[[]]],[11,"enable_rbf_with_sequence","","Enable signaling RBF with a specific nSequence value",84,[[]]],[11,"maintain_single_recipient","","Bump the fees of a transaction made with …",84,[[]]],[4,"TxOrdering","","Ordering of the transaction\'s inputs and outputs",null,null],[13,"Shuffle","","Randomized (default)",85,null],[13,"Untouched","","Unchanged",85,null],[13,"BIP69Lexicographic","","BIP69 / Lexicographic",85,null],[11,"sort_tx","","Sort transaction inputs and outputs by [<code>TxOrdering</code>] …",85,[[["transaction",3]]]],[4,"ChangeSpendPolicy","","Policy regarding the use of change outputs when creating …",null,null],[13,"ChangeAllowed","","Use both change and non-change outputs (default)",86,null],[13,"OnlyChange","","Only use change outputs (see [<code>TxBuilder::only_spend_change</code>…",86,null],[13,"ChangeForbidden","","Only use non-change outputs (see […",86,null],[8,"IsDust","bdk::wallet","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",87,[[]]],[6,"OfflineWallet","","Type alias for a [<code>Wallet</code>] that uses [<code>OfflineBlockchain</code>]",null,null],[3,"Wallet","","A Bitcoin wallet",null,null],[11,"new_offline","","Create a new \\\"offline\\\" wallet",88,[[["option",4],["network",4],["towalletdescriptor",8]],[["result",4],["error",4]]]],[11,"get_new_address","","Return a newly generated address using the external …",88,[[],[["address",3],["result",4],["error",4]]]],[11,"is_mine","","Return whether or not a <code>script</code> is part of this wallet …",88,[[["script",3]],[["result",4],["error",4]]]],[11,"list_unspent","","Return the list of unspent outputs of this wallet",88,[[],[["result",4],["vec",3],["error",4]]]],[11,"list_transactions","","Return the list of transactions made and received by the …",88,[[],[["error",4],["result",4],["vec",3]]]],[11,"get_balance","","Return the balance, meaning the sum of this wallet\'s …",88,[[],[["error",4],["result",4]]]],[11,"add_signer","","Add an external signer",88,[[["keychainkind",4],["signer",8],["arc",3],["signerordering",3],["signerid",4]]]],[11,"add_address_validator","","Add an address validator",88,[[["arc",3],["addressvalidator",8]]]],[11,"create_tx","","Create a new transaction following the options specified …",88,[[["coinselectionalgorithm",8],["txbuilder",3],["createtx",3]],[["result",4],["error",4]]]],[11,"bump_fee","","Bump the fee of a transaction following the options …",88,[[["txid",3],["coinselectionalgorithm",8],["txbuilder",3],["bumpfee",3]],[["result",4],["error",4]]]],[11,"sign","","Sign a transaction with all the wallet\'s signers, in the …",88,[[["option",4],["psbt",3]],[["result",4],["error",4]]]],[11,"policies","","Return the spending policies for the wallet\'s descriptor",88,[[["keychainkind",4]],[["error",4],["result",4],["option",4]]]],[11,"public_descriptor","","Return the \\\"public\\\" version of the wallet\'s descriptor, …",88,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"finalize_psbt","","Try to finalize a PSBT",88,[[["option",4],["psbt",3]],[["result",4],["error",4]]]],[11,"secp_ctx","","Return the secp256k1 context used for all signing …",88,[[],["secp256k1",3]]],[11,"new","","Create a new \\\"online\\\" wallet",88,[[["option",4],["network",4],["towalletdescriptor",8]],[["result",4],["error",4]]]],[11,"sync","","Sync the internal database with the blockchain",88,[[["option",4],["progress",8]],[["error",4],["result",4]]]],[11,"client","","Return a reference to the internal blockchain client",88,[[],["option",4]]],[11,"network","","Get the Bitcoin network the wallet is using.",88,[[],["network",4]]],[11,"broadcast","","Broadcast a transaction to the network",88,[[["transaction",3]],[["error",4],["result",4],["txid",3]]]],[4,"Error","bdk","Errors that can be thrown by the <code>Wallet</code>",null,null],[13,"InvalidU32Bytes","","Wrong number of bytes found when trying to convert to u32",89,null],[13,"Generic","","Generic error",89,null],[13,"ScriptDoesntHaveAddressForm","","This error is thrown when trying to convert Bare and …",89,null],[13,"SingleRecipientMultipleOutputs","","Found multiple outputs when <code>single_recipient</code> option has …",89,null],[13,"SingleRecipientNoInputs","","<code>single_recipient</code> option is selected but neither …",89,null],[13,"NoRecipients","","Cannot build a tx without recipients",89,null],[13,"NoUtxosSelected","","<code>manually_selected_only</code> option is selected but no utxo has …",89,null],[13,"OutputBelowDustLimit","","Output created is under the dust limit, 546 satoshis",89,null],[13,"InsufficientFunds","","Wallet\'s UTXO set is not enough to cover recipient\'s …",89,null],[13,"BnBTotalTriesExceeded","","Branch and bound coin selection possible attempts with …",89,null],[13,"BnBNoExactMatch","","Branch and bound coin selection tries to avoid needing a …",89,null],[13,"UnknownUTXO","","Happens when trying to spend an UTXO that is not in the …",89,null],[13,"TransactionNotFound","","Thrown when a tx is not found in the internal database",89,null],[13,"TransactionConfirmed","","Happens when trying to bump a transaction that is already …",89,null],[13,"IrreplaceableTransaction","","Trying to replace a tx that has a sequence >= <code>0xFFFFFFFE</code>",89,null],[13,"FeeRateTooLow","","When bumping a tx the fee rate requested is lower than …",89,null],[12,"required","bdk::Error","Required fee rate (satoshi/vbyte)",90,null],[13,"FeeTooLow","bdk","When bumping a tx the absolute fee requested is lower …",89,null],[12,"required","bdk::Error","Required fee absolute value (satoshi)",91,null],[13,"MissingKeyOrigin","bdk","In order to use the <code>TxBuilder::add_global_xpubs</code> option …",89,null],[13,"Key","","Error while working with <code>keys</code>",89,null],[13,"ChecksumMismatch","","Descriptor checksum mismatch",89,null],[13,"SpendingPolicyRequired","","Spending policy is not compatible with this <code>KeychainKind</code>",89,null],[13,"InvalidPolicyPathError","","Error while extracting and manipulating policies",89,null],[13,"Signer","","Signing error",89,null],[13,"OfflineClient","","Thrown when trying to call a method that requires a …",89,null],[13,"InvalidProgressValue","","Progress value must be between <code>0.0</code> (included) and <code>100.0</code> …",89,null],[13,"ProgressUpdateError","","Progress update error (maybe the channel has been closed)",89,null],[13,"InvalidOutpoint","","Requested outpoint doesn\'t exist in the tx (vout greater …",89,null],[13,"Descriptor","","Error related to the parsing and usage of descriptors",89,null],[13,"AddressValidator","","Error that can be returned to fail the validation of an …",89,null],[13,"Encode","","Encoding error",89,null],[13,"Miniscript","","Miniscript error",89,null],[13,"BIP32","","BIP32 error",89,null],[13,"Secp256k1","","An ECDSA error",89,null],[13,"JSON","","Error serializing or deserializing JSON data",89,null],[13,"Hex","","Hex decoding error",89,null],[13,"PSBT","","Partially signed bitcoin transaction error",89,null],[13,"Electrum","","Electrum client error",89,null],[13,"Esplora","","Esplora client error",89,null],[13,"CompactFilters","","Compact filters client error)",89,null],[13,"Sled","","Sled database error",89,null],[4,"KeychainKind","","Types of keychains",null,null],[13,"External","","External",92,null],[13,"Internal","","Internal, usually used for change outputs",92,null],[3,"FeeRate","","Fee rate",null,null],[3,"UTXO","","A wallet unspent output",null,null],[12,"outpoint","","Reference to a transaction output",93,null],[12,"txout","","Transaction output",93,null],[12,"keychain","","Type of keychain",93,null],[3,"TransactionDetails","","A wallet transaction",null,null],[12,"transaction","","Optional transaction",94,null],[12,"txid","","Transaction id",94,null],[12,"timestamp","","Timestamp",94,null],[12,"received","","Received value (sats)",94,null],[12,"sent","","Sent value (sats)",94,null],[12,"fees","","Fee value (sats)",94,null],[12,"height","","Confirmed in block height, <code>None</code> means unconfirmed",94,null],[14,"descriptor","","Macro to write full descriptors with code",null,null],[14,"fragment","","Macro to write descriptor fragments with code",null,null],[11,"from","","",89,[[]]],[11,"into","","",89,[[]]],[11,"to_string","","",89,[[],["string",3]]],[11,"borrow","","",89,[[]]],[11,"borrow_mut","","",89,[[]]],[11,"try_from","","",89,[[],["result",4]]],[11,"try_into","","",89,[[],["result",4]]],[11,"type_id","","",89,[[],["typeid",3]]],[11,"vzip","","",89,[[]]],[11,"init","","",89,[[]]],[11,"deref","","",89,[[]]],[11,"deref_mut","","",89,[[]]],[11,"drop","","",89,[[]]],[11,"from","bdk::blockchain::any","",0,[[]]],[11,"into","","",0,[[]]],[11,"borrow","","",0,[[]]],[11,"borrow_mut","","",0,[[]]],[11,"try_from","","",0,[[],["result",4]]],[11,"try_into","","",0,[[],["result",4]]],[11,"type_id","","",0,[[],["typeid",3]]],[11,"vzip","","",0,[[]]],[11,"init","","",0,[[]]],[11,"deref","","",0,[[]]],[11,"deref_mut","","",0,[[]]],[11,"drop","","",0,[[]]],[11,"from","","",1,[[]]],[11,"into","","",1,[[]]],[11,"borrow","","",1,[[]]],[11,"borrow_mut","","",1,[[]]],[11,"try_from","","",1,[[],["result",4]]],[11,"try_into","","",1,[[],["result",4]]],[11,"type_id","","",1,[[],["typeid",3]]],[11,"vzip","","",1,[[]]],[11,"init","","",1,[[]]],[11,"deref","","",1,[[]]],[11,"deref_mut","","",1,[[]]],[11,"drop","","",1,[[]]],[11,"from","bdk::blockchain::electrum","",95,[[]]],[11,"into","","",95,[[]]],[11,"borrow","","",95,[[]]],[11,"borrow_mut","","",95,[[]]],[11,"try_from","","",95,[[],["result",4]]],[11,"try_into","","",95,[[],["result",4]]],[11,"type_id","","",95,[[],["typeid",3]]],[11,"vzip","","",95,[[]]],[11,"init","","",95,[[]]],[11,"deref","","",95,[[]]],[11,"deref_mut","","",95,[[]]],[11,"drop","","",95,[[]]],[11,"from","","",2,[[]]],[11,"into","","",2,[[]]],[11,"borrow","","",2,[[]]],[11,"borrow_mut","","",2,[[]]],[11,"try_from","","",2,[[],["result",4]]],[11,"try_into","","",2,[[],["result",4]]],[11,"type_id","","",2,[[],["typeid",3]]],[11,"vzip","","",2,[[]]],[11,"init","","",2,[[]]],[11,"deref","","",2,[[]]],[11,"deref_mut","","",2,[[]]],[11,"drop","","",2,[[]]],[11,"from","bdk::blockchain::esplora","",3,[[]]],[11,"into","","",3,[[]]],[11,"borrow","","",3,[[]]],[11,"borrow_mut","","",3,[[]]],[11,"try_from","","",3,[[],["result",4]]],[11,"try_into","","",3,[[],["result",4]]],[11,"type_id","","",3,[[],["typeid",3]]],[11,"vzip","","",3,[[]]],[11,"init","","",3,[[]]],[11,"deref","","",3,[[]]],[11,"deref_mut","","",3,[[]]],[11,"drop","","",3,[[]]],[11,"from","","",4,[[]]],[11,"into","","",4,[[]]],[11,"borrow","","",4,[[]]],[11,"borrow_mut","","",4,[[]]],[11,"try_from","","",4,[[],["result",4]]],[11,"try_into","","",4,[[],["result",4]]],[11,"type_id","","",4,[[],["typeid",3]]],[11,"vzip","","",4,[[]]],[11,"init","","",4,[[]]],[11,"deref","","",4,[[]]],[11,"deref_mut","","",4,[[]]],[11,"drop","","",4,[[]]],[11,"from","","",5,[[]]],[11,"into","","",5,[[]]],[11,"to_string","","",5,[[],["string",3]]],[11,"borrow","","",5,[[]]],[11,"borrow_mut","","",5,[[]]],[11,"try_from","","",5,[[],["result",4]]],[11,"try_into","","",5,[[],["result",4]]],[11,"type_id","","",5,[[],["typeid",3]]],[11,"vzip","","",5,[[]]],[11,"init","","",5,[[]]],[11,"deref","","",5,[[]]],[11,"deref_mut","","",5,[[]]],[11,"drop","","",5,[[]]],[11,"from","bdk::blockchain::compact_filters","",96,[[]]],[11,"into","","",96,[[]]],[11,"borrow","","",96,[[]]],[11,"borrow_mut","","",96,[[]]],[11,"try_from","","",96,[[],["result",4]]],[11,"try_into","","",96,[[],["result",4]]],[11,"type_id","","",96,[[],["typeid",3]]],[11,"vzip","","",96,[[]]],[11,"init","","",96,[[]]],[11,"deref","","",96,[[]]],[11,"deref_mut","","",96,[[]]],[11,"drop","","",96,[[]]],[11,"from","","",97,[[]]],[11,"into","","",97,[[]]],[11,"borrow","","",97,[[]]],[11,"borrow_mut","","",97,[[]]],[11,"try_from","","",97,[[],["result",4]]],[11,"try_into","","",97,[[],["result",4]]],[11,"type_id","","",97,[[],["typeid",3]]],[11,"vzip","","",97,[[]]],[11,"init","","",97,[[]]],[11,"deref","","",97,[[]]],[11,"deref_mut","","",97,[[]]],[11,"drop","","",97,[[]]],[11,"from","","",6,[[]]],[11,"into","","",6,[[]]],[11,"borrow","","",6,[[]]],[11,"borrow_mut","","",6,[[]]],[11,"try_from","","",6,[[],["result",4]]],[11,"try_into","","",6,[[],["result",4]]],[11,"type_id","","",6,[[],["typeid",3]]],[11,"vzip","","",6,[[]]],[11,"init","","",6,[[]]],[11,"deref","","",6,[[]]],[11,"deref_mut","","",6,[[]]],[11,"drop","","",6,[[]]],[11,"from","","",7,[[]]],[11,"into","","",7,[[]]],[11,"borrow","","",7,[[]]],[11,"borrow_mut","","",7,[[]]],[11,"try_from","","",7,[[],["result",4]]],[11,"try_into","","",7,[[],["result",4]]],[11,"type_id","","",7,[[],["typeid",3]]],[11,"vzip","","",7,[[]]],[11,"init","","",7,[[]]],[11,"deref","","",7,[[]]],[11,"deref_mut","","",7,[[]]],[11,"drop","","",7,[[]]],[11,"from","","",8,[[]]],[11,"into","","",8,[[]]],[11,"borrow","","",8,[[]]],[11,"borrow_mut","","",8,[[]]],[11,"try_from","","",8,[[],["result",4]]],[11,"try_into","","",8,[[],["result",4]]],[11,"type_id","","",8,[[],["typeid",3]]],[11,"vzip","","",8,[[]]],[11,"init","","",8,[[]]],[11,"deref","","",8,[[]]],[11,"deref_mut","","",8,[[]]],[11,"drop","","",8,[[]]],[11,"from","","",9,[[]]],[11,"into","","",9,[[]]],[11,"to_string","","",9,[[],["string",3]]],[11,"borrow","","",9,[[]]],[11,"borrow_mut","","",9,[[]]],[11,"try_from","","",9,[[],["result",4]]],[11,"try_into","","",9,[[],["result",4]]],[11,"type_id","","",9,[[],["typeid",3]]],[11,"vzip","","",9,[[]]],[11,"init","","",9,[[]]],[11,"deref","","",9,[[]]],[11,"deref_mut","","",9,[[]]],[11,"drop","","",9,[[]]],[11,"from","bdk::blockchain","",10,[[]]],[11,"into","","",10,[[]]],[11,"to_owned","","",10,[[]]],[11,"clone_into","","",10,[[]]],[11,"borrow","","",10,[[]]],[11,"borrow_mut","","",10,[[]]],[11,"try_from","","",10,[[],["result",4]]],[11,"try_into","","",10,[[],["result",4]]],[11,"type_id","","",10,[[],["typeid",3]]],[11,"vzip","","",10,[[]]],[11,"equivalent","","",10,[[]]],[11,"init","","",10,[[]]],[11,"deref","","",10,[[]]],[11,"deref_mut","","",10,[[]]],[11,"drop","","",10,[[]]],[11,"from","","",98,[[]]],[11,"into","","",98,[[]]],[11,"borrow","","",98,[[]]],[11,"borrow_mut","","",98,[[]]],[11,"try_from","","",98,[[],["result",4]]],[11,"try_into","","",98,[[],["result",4]]],[11,"type_id","","",98,[[],["typeid",3]]],[11,"vzip","","",98,[[]]],[11,"init","","",98,[[]]],[11,"deref","","",98,[[]]],[11,"deref_mut","","",98,[[]]],[11,"drop","","",98,[[]]],[11,"from","","",99,[[]]],[11,"into","","",99,[[]]],[11,"to_owned","","",99,[[]]],[11,"clone_into","","",99,[[]]],[11,"borrow","","",99,[[]]],[11,"borrow_mut","","",99,[[]]],[11,"try_from","","",99,[[],["result",4]]],[11,"try_into","","",99,[[],["result",4]]],[11,"type_id","","",99,[[],["typeid",3]]],[11,"vzip","","",99,[[]]],[11,"init","","",99,[[]]],[11,"deref","","",99,[[]]],[11,"deref_mut","","",99,[[]]],[11,"drop","","",99,[[]]],[11,"from","","",100,[[]]],[11,"into","","",100,[[]]],[11,"to_owned","","",100,[[]]],[11,"clone_into","","",100,[[]]],[11,"borrow","","",100,[[]]],[11,"borrow_mut","","",100,[[]]],[11,"try_from","","",100,[[],["result",4]]],[11,"try_into","","",100,[[],["result",4]]],[11,"type_id","","",100,[[],["typeid",3]]],[11,"vzip","","",100,[[]]],[11,"init","","",100,[[]]],[11,"deref","","",100,[[]]],[11,"deref_mut","","",100,[[]]],[11,"drop","","",100,[[]]],[11,"from","bdk::database::any","",14,[[]]],[11,"into","","",14,[[]]],[11,"borrow","","",14,[[]]],[11,"borrow_mut","","",14,[[]]],[11,"try_from","","",14,[[],["result",4]]],[11,"try_into","","",14,[[],["result",4]]],[11,"type_id","","",14,[[],["typeid",3]]],[11,"vzip","","",14,[[]]],[11,"init","","",14,[[]]],[11,"deref","","",14,[[]]],[11,"deref_mut","","",14,[[]]],[11,"drop","","",14,[[]]],[11,"from","","",15,[[]]],[11,"into","","",15,[[]]],[11,"borrow","","",15,[[]]],[11,"borrow_mut","","",15,[[]]],[11,"try_from","","",15,[[],["result",4]]],[11,"try_into","","",15,[[],["result",4]]],[11,"type_id","","",15,[[],["typeid",3]]],[11,"vzip","","",15,[[]]],[11,"init","","",15,[[]]],[11,"deref","","",15,[[]]],[11,"deref_mut","","",15,[[]]],[11,"drop","","",15,[[]]],[11,"from","","",16,[[]]],[11,"into","","",16,[[]]],[11,"borrow","","",16,[[]]],[11,"borrow_mut","","",16,[[]]],[11,"try_from","","",16,[[],["result",4]]],[11,"try_into","","",16,[[],["result",4]]],[11,"type_id","","",16,[[],["typeid",3]]],[11,"vzip","","",16,[[]]],[11,"init","","",16,[[]]],[11,"deref","","",16,[[]]],[11,"deref_mut","","",16,[[]]],[11,"drop","","",16,[[]]],[11,"from","","",17,[[]]],[11,"into","","",17,[[]]],[11,"borrow","","",17,[[]]],[11,"borrow_mut","","",17,[[]]],[11,"try_from","","",17,[[],["result",4]]],[11,"try_into","","",17,[[],["result",4]]],[11,"type_id","","",17,[[],["typeid",3]]],[11,"vzip","","",17,[[]]],[11,"init","","",17,[[]]],[11,"deref","","",17,[[]]],[11,"deref_mut","","",17,[[]]],[11,"drop","","",17,[[]]],[11,"from","bdk::database::memory","",18,[[]]],[11,"into","","",18,[[]]],[11,"borrow","","",18,[[]]],[11,"borrow_mut","","",18,[[]]],[11,"try_from","","",18,[[],["result",4]]],[11,"try_into","","",18,[[],["result",4]]],[11,"type_id","","",18,[[],["typeid",3]]],[11,"vzip","","",18,[[]]],[11,"init","","",18,[[]]],[11,"deref","","",18,[[]]],[11,"deref_mut","","",18,[[]]],[11,"drop","","",18,[[]]],[11,"from","bdk::descriptor","",23,[[]]],[11,"into","","",23,[[]]],[11,"to_owned","","",23,[[]]],[11,"clone_into","","",23,[[]]],[11,"to_string","","",23,[[],["string",3]]],[11,"borrow","","",23,[[]]],[11,"borrow_mut","","",23,[[]]],[11,"try_from","","",23,[[],["result",4]]],[11,"try_into","","",23,[[],["result",4]]],[11,"type_id","","",23,[[],["typeid",3]]],[11,"vzip","","",23,[[]]],[11,"equivalent","","",23,[[]]],[11,"init","","",23,[[]]],[11,"deref","","",23,[[]]],[11,"deref_mut","","",23,[[]]],[11,"drop","","",23,[[]]],[11,"as_enum","","",101,[[],["scriptcontextenum",4]]],[11,"from","","",101,[[]]],[11,"into","","",101,[[]]],[11,"to_owned","","",101,[[]]],[11,"clone_into","","",101,[[]]],[11,"borrow","","",101,[[]]],[11,"borrow_mut","","",101,[[]]],[11,"try_from","","",101,[[],["result",4]]],[11,"try_into","","",101,[[],["result",4]]],[11,"type_id","","",101,[[],["typeid",3]]],[11,"vzip","","",101,[[]]],[11,"equivalent","","",101,[[]]],[11,"init","","",101,[[]]],[11,"deref","","",101,[[]]],[11,"deref_mut","","",101,[[]]],[11,"drop","","",101,[[]]],[11,"from","","",24,[[]]],[11,"into","","",24,[[]]],[11,"to_owned","","",24,[[]]],[11,"clone_into","","",24,[[]]],[11,"to_string","","",24,[[],["string",3]]],[11,"borrow","","",24,[[]]],[11,"borrow_mut","","",24,[[]]],[11,"try_from","","",24,[[],["result",4]]],[11,"try_into","","",24,[[],["result",4]]],[11,"type_id","","",24,[[],["typeid",3]]],[11,"vzip","","",24,[[]]],[11,"equivalent","","",24,[[]]],[11,"init","","",24,[[]]],[11,"deref","","",24,[[]]],[11,"deref_mut","","",24,[[]]],[11,"drop","","",24,[[]]],[11,"as_enum","","",102,[[],["scriptcontextenum",4]]],[11,"from","","",102,[[]]],[11,"into","","",102,[[]]],[11,"to_owned","","",102,[[]]],[11,"clone_into","","",102,[[]]],[11,"borrow","","",102,[[]]],[11,"borrow_mut","","",102,[[]]],[11,"try_from","","",102,[[],["result",4]]],[11,"try_into","","",102,[[],["result",4]]],[11,"type_id","","",102,[[],["typeid",3]]],[11,"vzip","","",102,[[]]],[11,"equivalent","","",102,[[]]],[11,"init","","",102,[[]]],[11,"deref","","",102,[[]]],[11,"deref_mut","","",102,[[]]],[11,"drop","","",102,[[]]],[11,"from","","",27,[[]]],[11,"into","","",27,[[]]],[11,"to_owned","","",27,[[]]],[11,"clone_into","","",27,[[]]],[11,"to_string","","",27,[[],["string",3]]],[11,"borrow","","",27,[[]]],[11,"borrow_mut","","",27,[[]]],[11,"try_from","","",27,[[],["result",4]]],[11,"try_into","","",27,[[],["result",4]]],[11,"type_id","","",27,[[],["typeid",3]]],[11,"vzip","","",27,[[]]],[11,"equivalent","","",27,[[]]],[11,"init","","",27,[[]]],[11,"deref","","",27,[[]]],[11,"deref_mut","","",27,[[]]],[11,"drop","","",27,[[]]],[11,"from","bdk::descriptor::error","",29,[[]]],[11,"into","","",29,[[]]],[11,"to_string","","",29,[[],["string",3]]],[11,"borrow","","",29,[[]]],[11,"borrow_mut","","",29,[[]]],[11,"try_from","","",29,[[],["result",4]]],[11,"try_into","","",29,[[],["result",4]]],[11,"type_id","","",29,[[],["typeid",3]]],[11,"vzip","","",29,[[]]],[11,"init","","",29,[[]]],[11,"deref","","",29,[[]]],[11,"deref_mut","","",29,[[]]],[11,"drop","","",29,[[]]],[11,"from","bdk::descriptor::policy","",103,[[]]],[11,"into","","",103,[[]]],[11,"to_owned","","",103,[[]]],[11,"clone_into","","",103,[[]]],[11,"borrow","","",103,[[]]],[11,"borrow_mut","","",103,[[]]],[11,"try_from","","",103,[[],["result",4]]],[11,"try_into","","",103,[[],["result",4]]],[11,"type_id","","",103,[[],["typeid",3]]],[11,"vzip","","",103,[[]]],[11,"init","","",103,[[]]],[11,"deref","","",103,[[]]],[11,"deref_mut","","",103,[[]]],[11,"drop","","",103,[[]]],[11,"from","","",30,[[]]],[11,"into","","",30,[[]]],[11,"to_owned","","",30,[[]]],[11,"clone_into","","",30,[[]]],[11,"borrow","","",30,[[]]],[11,"borrow_mut","","",30,[[]]],[11,"try_from","","",30,[[],["result",4]]],[11,"try_into","","",30,[[],["result",4]]],[11,"type_id","","",30,[[],["typeid",3]]],[11,"vzip","","",30,[[]]],[11,"init","","",30,[[]]],[11,"deref","","",30,[[]]],[11,"deref_mut","","",30,[[]]],[11,"drop","","",30,[[]]],[11,"from","","",39,[[]]],[11,"into","","",39,[[]]],[11,"to_owned","","",39,[[]]],[11,"clone_into","","",39,[[]]],[11,"borrow","","",39,[[]]],[11,"borrow_mut","","",39,[[]]],[11,"try_from","","",39,[[],["result",4]]],[11,"try_into","","",39,[[],["result",4]]],[11,"type_id","","",39,[[],["typeid",3]]],[11,"vzip","","",39,[[]]],[11,"init","","",39,[[]]],[11,"deref","","",39,[[]]],[11,"deref_mut","","",39,[[]]],[11,"drop","","",39,[[]]],[11,"from","","",43,[[]]],[11,"into","","",43,[[]]],[11,"to_owned","","",43,[[]]],[11,"clone_into","","",43,[[]]],[11,"borrow","","",43,[[]]],[11,"borrow_mut","","",43,[[]]],[11,"try_from","","",43,[[],["result",4]]],[11,"try_into","","",43,[[],["result",4]]],[11,"type_id","","",43,[[],["typeid",3]]],[11,"vzip","","",43,[[]]],[11,"init","","",43,[[]]],[11,"deref","","",43,[[]]],[11,"deref_mut","","",43,[[]]],[11,"drop","","",43,[[]]],[11,"from","","",44,[[]]],[11,"into","","",44,[[]]],[11,"to_owned","","",44,[[]]],[11,"clone_into","","",44,[[]]],[11,"borrow","","",44,[[]]],[11,"borrow_mut","","",44,[[]]],[11,"try_from","","",44,[[],["result",4]]],[11,"try_into","","",44,[[],["result",4]]],[11,"type_id","","",44,[[],["typeid",3]]],[11,"vzip","","",44,[[]]],[11,"equivalent","","",44,[[]]],[11,"init","","",44,[[]]],[11,"deref","","",44,[[]]],[11,"deref_mut","","",44,[[]]],[11,"drop","","",44,[[]]],[11,"from","","",45,[[]]],[11,"into","","",45,[[]]],[11,"to_string","","",45,[[],["string",3]]],[11,"borrow","","",45,[[]]],[11,"borrow_mut","","",45,[[]]],[11,"try_from","","",45,[[],["result",4]]],[11,"try_into","","",45,[[],["result",4]]],[11,"type_id","","",45,[[],["typeid",3]]],[11,"vzip","","",45,[[]]],[11,"init","","",45,[[]]],[11,"deref","","",45,[[]]],[11,"deref_mut","","",45,[[]]],[11,"drop","","",45,[[]]],[11,"to_wallet_descriptor","bdk::descriptor::template","",47,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",47,[[]]],[11,"into","","",47,[[]]],[11,"borrow","","",47,[[]]],[11,"borrow_mut","","",47,[[]]],[11,"try_from","","",47,[[],["result",4]]],[11,"try_into","","",47,[[],["result",4]]],[11,"type_id","","",47,[[],["typeid",3]]],[11,"vzip","","",47,[[]]],[11,"init","","",47,[[]]],[11,"deref","","",47,[[]]],[11,"deref_mut","","",47,[[]]],[11,"drop","","",47,[[]]],[11,"to_wallet_descriptor","","",48,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",48,[[]]],[11,"into","","",48,[[]]],[11,"borrow","","",48,[[]]],[11,"borrow_mut","","",48,[[]]],[11,"try_from","","",48,[[],["result",4]]],[11,"try_into","","",48,[[],["result",4]]],[11,"type_id","","",48,[[],["typeid",3]]],[11,"vzip","","",48,[[]]],[11,"init","","",48,[[]]],[11,"deref","","",48,[[]]],[11,"deref_mut","","",48,[[]]],[11,"drop","","",48,[[]]],[11,"to_wallet_descriptor","","",49,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",49,[[]]],[11,"into","","",49,[[]]],[11,"borrow","","",49,[[]]],[11,"borrow_mut","","",49,[[]]],[11,"try_from","","",49,[[],["result",4]]],[11,"try_into","","",49,[[],["result",4]]],[11,"type_id","","",49,[[],["typeid",3]]],[11,"vzip","","",49,[[]]],[11,"init","","",49,[[]]],[11,"deref","","",49,[[]]],[11,"deref_mut","","",49,[[]]],[11,"drop","","",49,[[]]],[11,"to_wallet_descriptor","","",50,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",50,[[]]],[11,"into","","",50,[[]]],[11,"borrow","","",50,[[]]],[11,"borrow_mut","","",50,[[]]],[11,"try_from","","",50,[[],["result",4]]],[11,"try_into","","",50,[[],["result",4]]],[11,"type_id","","",50,[[],["typeid",3]]],[11,"vzip","","",50,[[]]],[11,"init","","",50,[[]]],[11,"deref","","",50,[[]]],[11,"deref_mut","","",50,[[]]],[11,"drop","","",50,[[]]],[11,"to_wallet_descriptor","","",51,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",51,[[]]],[11,"into","","",51,[[]]],[11,"borrow","","",51,[[]]],[11,"borrow_mut","","",51,[[]]],[11,"try_from","","",51,[[],["result",4]]],[11,"try_into","","",51,[[],["result",4]]],[11,"type_id","","",51,[[],["typeid",3]]],[11,"vzip","","",51,[[]]],[11,"init","","",51,[[]]],[11,"deref","","",51,[[]]],[11,"deref_mut","","",51,[[]]],[11,"drop","","",51,[[]]],[11,"to_wallet_descriptor","","",52,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",52,[[]]],[11,"into","","",52,[[]]],[11,"borrow","","",52,[[]]],[11,"borrow_mut","","",52,[[]]],[11,"try_from","","",52,[[],["result",4]]],[11,"try_into","","",52,[[],["result",4]]],[11,"type_id","","",52,[[],["typeid",3]]],[11,"vzip","","",52,[[]]],[11,"init","","",52,[[]]],[11,"deref","","",52,[[]]],[11,"deref_mut","","",52,[[]]],[11,"drop","","",52,[[]]],[11,"to_wallet_descriptor","","",53,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",53,[[]]],[11,"into","","",53,[[]]],[11,"borrow","","",53,[[]]],[11,"borrow_mut","","",53,[[]]],[11,"try_from","","",53,[[],["result",4]]],[11,"try_into","","",53,[[],["result",4]]],[11,"type_id","","",53,[[],["typeid",3]]],[11,"vzip","","",53,[[]]],[11,"init","","",53,[[]]],[11,"deref","","",53,[[]]],[11,"deref_mut","","",53,[[]]],[11,"drop","","",53,[[]]],[11,"to_wallet_descriptor","","",54,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",54,[[]]],[11,"into","","",54,[[]]],[11,"borrow","","",54,[[]]],[11,"borrow_mut","","",54,[[]]],[11,"try_from","","",54,[[],["result",4]]],[11,"try_into","","",54,[[],["result",4]]],[11,"type_id","","",54,[[],["typeid",3]]],[11,"vzip","","",54,[[]]],[11,"init","","",54,[[]]],[11,"deref","","",54,[[]]],[11,"deref_mut","","",54,[[]]],[11,"drop","","",54,[[]]],[11,"to_wallet_descriptor","","",55,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"from","","",55,[[]]],[11,"into","","",55,[[]]],[11,"borrow","","",55,[[]]],[11,"borrow_mut","","",55,[[]]],[11,"try_from","","",55,[[],["result",4]]],[11,"try_into","","",55,[[],["result",4]]],[11,"type_id","","",55,[[],["typeid",3]]],[11,"vzip","","",55,[[]]],[11,"init","","",55,[[]]],[11,"deref","","",55,[[]]],[11,"deref_mut","","",55,[[]]],[11,"drop","","",55,[[]]],[11,"from","bdk::keys","",58,[[]]],[11,"into","","",58,[[]]],[11,"to_owned","","",58,[[]]],[11,"clone_into","","",58,[[]]],[11,"to_string","","",58,[[],["string",3]]],[11,"borrow","","",58,[[]]],[11,"borrow_mut","","",58,[[]]],[11,"try_from","","",58,[[],["result",4]]],[11,"try_into","","",58,[[],["result",4]]],[11,"type_id","","",58,[[],["typeid",3]]],[11,"vzip","","",58,[[]]],[11,"equivalent","","",58,[[]]],[11,"init","","",58,[[]]],[11,"deref","","",58,[[]]],[11,"deref_mut","","",58,[[]]],[11,"drop","","",58,[[]]],[11,"from","","",59,[[]]],[11,"into","","",59,[[]]],[11,"to_string","","",59,[[],["string",3]]],[11,"borrow","","",59,[[]]],[11,"borrow_mut","","",59,[[]]],[11,"try_from","","",59,[[],["result",4]]],[11,"try_into","","",59,[[],["result",4]]],[11,"type_id","","",59,[[],["typeid",3]]],[11,"vzip","","",59,[[]]],[11,"init","","",59,[[]]],[11,"deref","","",59,[[]]],[11,"deref_mut","","",59,[[]]],[11,"drop","","",59,[[]]],[11,"from","","",60,[[]]],[11,"into","","",60,[[]]],[11,"borrow","","",60,[[]]],[11,"borrow_mut","","",60,[[]]],[11,"try_from","","",60,[[],["result",4]]],[11,"try_into","","",60,[[],["result",4]]],[11,"type_id","","",60,[[],["typeid",3]]],[11,"vzip","","",60,[[]]],[11,"init","","",60,[[]]],[11,"deref","","",60,[[]]],[11,"deref_mut","","",60,[[]]],[11,"drop","","",60,[[]]],[11,"from","","",61,[[]]],[11,"into","","",61,[[]]],[11,"to_owned","","",61,[[]]],[11,"clone_into","","",61,[[]]],[11,"borrow","","",61,[[]]],[11,"borrow_mut","","",61,[[]]],[11,"try_from","","",61,[[],["result",4]]],[11,"try_into","","",61,[[],["result",4]]],[11,"type_id","","",61,[[],["typeid",3]]],[11,"vzip","","",61,[[]]],[11,"equivalent","","",61,[[]]],[11,"init","","",61,[[]]],[11,"deref","","",61,[[]]],[11,"deref_mut","","",61,[[]]],[11,"drop","","",61,[[]]],[11,"from","","",62,[[]]],[11,"into","","",62,[[]]],[11,"to_owned","","",62,[[]]],[11,"clone_into","","",62,[[]]],[11,"to_string","","",62,[[],["string",3]]],[11,"borrow","","",62,[[]]],[11,"borrow_mut","","",62,[[]]],[11,"try_from","","",62,[[],["result",4]]],[11,"try_into","","",62,[[],["result",4]]],[11,"type_id","","",62,[[],["typeid",3]]],[11,"vzip","","",62,[[]]],[11,"equivalent","","",62,[[]]],[11,"init","","",62,[[]]],[11,"deref","","",62,[[]]],[11,"deref_mut","","",62,[[]]],[11,"drop","","",62,[[]]],[11,"from","","",63,[[]]],[11,"into","","",63,[[]]],[11,"borrow","","",63,[[]]],[11,"borrow_mut","","",63,[[]]],[11,"try_from","","",63,[[],["result",4]]],[11,"try_into","","",63,[[],["result",4]]],[11,"type_id","","",63,[[],["typeid",3]]],[11,"vzip","","",63,[[]]],[11,"init","","",63,[[]]],[11,"deref","","",63,[[]]],[11,"deref_mut","","",63,[[]]],[11,"drop","","",63,[[]]],[11,"from","","",64,[[]]],[11,"into","","",64,[[]]],[11,"to_owned","","",64,[[]]],[11,"clone_into","","",64,[[]]],[11,"borrow","","",64,[[]]],[11,"borrow_mut","","",64,[[]]],[11,"try_from","","",64,[[],["result",4]]],[11,"try_into","","",64,[[],["result",4]]],[11,"type_id","","",64,[[],["typeid",3]]],[11,"vzip","","",64,[[]]],[11,"equivalent","","",64,[[]]],[11,"init","","",64,[[]]],[11,"deref","","",64,[[]]],[11,"deref_mut","","",64,[[]]],[11,"drop","","",64,[[]]],[11,"from","","",68,[[]]],[11,"into","","",68,[[]]],[11,"borrow","","",68,[[]]],[11,"borrow_mut","","",68,[[]]],[11,"try_from","","",68,[[],["result",4]]],[11,"try_into","","",68,[[],["result",4]]],[11,"type_id","","",68,[[],["typeid",3]]],[11,"vzip","","",68,[[]]],[11,"init","","",68,[[]]],[11,"deref","","",68,[[]]],[11,"deref_mut","","",68,[[]]],[11,"drop","","",68,[[]]],[11,"from","","",71,[[]]],[11,"into","","",71,[[]]],[11,"to_owned","","",71,[[]]],[11,"clone_into","","",71,[[]]],[11,"borrow","","",71,[[]]],[11,"borrow_mut","","",71,[[]]],[11,"try_from","","",71,[[],["result",4]]],[11,"try_into","","",71,[[],["result",4]]],[11,"type_id","","",71,[[],["typeid",3]]],[11,"vzip","","",71,[[]]],[11,"init","","",71,[[]]],[11,"deref","","",71,[[]]],[11,"deref_mut","","",71,[[]]],[11,"drop","","",71,[[]]],[11,"from","","",72,[[]]],[11,"into","","",72,[[]]],[11,"to_string","","",72,[[],["string",3]]],[11,"borrow","","",72,[[]]],[11,"borrow_mut","","",72,[[]]],[11,"try_from","","",72,[[],["result",4]]],[11,"try_into","","",72,[[],["result",4]]],[11,"type_id","","",72,[[],["typeid",3]]],[11,"vzip","","",72,[[]]],[11,"init","","",72,[[]]],[11,"deref","","",72,[[]]],[11,"deref_mut","","",72,[[]]],[11,"drop","","",72,[[]]],[11,"from","bdk","",92,[[]]],[11,"into","","",92,[[]]],[11,"to_owned","","",92,[[]]],[11,"clone_into","","",92,[[]]],[11,"borrow","","",92,[[]]],[11,"borrow_mut","","",92,[[]]],[11,"try_from","","",92,[[],["result",4]]],[11,"try_into","","",92,[[],["result",4]]],[11,"type_id","","",92,[[],["typeid",3]]],[11,"write_base32","","",92,[[],["result",4]]],[11,"base32_len","","",92,[[]]],[11,"check_base32","","",92,[[],[["result",4],["vec",3]]]],[11,"vzip","","",92,[[]]],[11,"equivalent","","",92,[[]]],[11,"init","","",92,[[]]],[11,"deref","","",92,[[]]],[11,"deref_mut","","",92,[[]]],[11,"drop","","",92,[[]]],[11,"from","","",104,[[]]],[11,"into","","",104,[[]]],[11,"to_owned","","",104,[[]]],[11,"clone_into","","",104,[[]]],[11,"borrow","","",104,[[]]],[11,"borrow_mut","","",104,[[]]],[11,"try_from","","",104,[[],["result",4]]],[11,"try_into","","",104,[[],["result",4]]],[11,"type_id","","",104,[[],["typeid",3]]],[11,"vzip","","",104,[[]]],[11,"init","","",104,[[]]],[11,"deref","","",104,[[]]],[11,"deref_mut","","",104,[[]]],[11,"drop","","",104,[[]]],[11,"from","","",93,[[]]],[11,"into","","",93,[[]]],[11,"to_owned","","",93,[[]]],[11,"clone_into","","",93,[[]]],[11,"borrow","","",93,[[]]],[11,"borrow_mut","","",93,[[]]],[11,"try_from","","",93,[[],["result",4]]],[11,"try_into","","",93,[[],["result",4]]],[11,"type_id","","",93,[[],["typeid",3]]],[11,"vzip","","",93,[[]]],[11,"equivalent","","",93,[[]]],[11,"init","","",93,[[]]],[11,"deref","","",93,[[]]],[11,"deref_mut","","",93,[[]]],[11,"drop","","",93,[[]]],[11,"from","","",94,[[]]],[11,"into","","",94,[[]]],[11,"to_owned","","",94,[[]]],[11,"clone_into","","",94,[[]]],[11,"borrow","","",94,[[]]],[11,"borrow_mut","","",94,[[]]],[11,"try_from","","",94,[[],["result",4]]],[11,"try_into","","",94,[[],["result",4]]],[11,"type_id","","",94,[[],["typeid",3]]],[11,"vzip","","",94,[[]]],[11,"equivalent","","",94,[[]]],[11,"init","","",94,[[]]],[11,"deref","","",94,[[]]],[11,"deref_mut","","",94,[[]]],[11,"drop","","",94,[[]]],[11,"from","bdk::wallet::address_validator","",73,[[]]],[11,"into","","",73,[[]]],[11,"to_owned","","",73,[[]]],[11,"clone_into","","",73,[[]]],[11,"to_string","","",73,[[],["string",3]]],[11,"borrow","","",73,[[]]],[11,"borrow_mut","","",73,[[]]],[11,"try_from","","",73,[[],["result",4]]],[11,"try_into","","",73,[[],["result",4]]],[11,"type_id","","",73,[[],["typeid",3]]],[11,"vzip","","",73,[[]]],[11,"equivalent","","",73,[[]]],[11,"init","","",73,[[]]],[11,"deref","","",73,[[]]],[11,"deref_mut","","",73,[[]]],[11,"drop","","",73,[[]]],[11,"from","bdk::wallet::coin_selection","",75,[[]]],[11,"into","","",75,[[]]],[11,"borrow","","",75,[[]]],[11,"borrow_mut","","",75,[[]]],[11,"try_from","","",75,[[],["result",4]]],[11,"try_into","","",75,[[],["result",4]]],[11,"type_id","","",75,[[],["typeid",3]]],[11,"vzip","","",75,[[]]],[11,"init","","",75,[[]]],[11,"deref","","",75,[[]]],[11,"deref_mut","","",75,[[]]],[11,"drop","","",75,[[]]],[11,"from","","",105,[[]]],[11,"into","","",105,[[]]],[11,"borrow","","",105,[[]]],[11,"borrow_mut","","",105,[[]]],[11,"try_from","","",105,[[],["result",4]]],[11,"try_into","","",105,[[],["result",4]]],[11,"type_id","","",105,[[],["typeid",3]]],[11,"vzip","","",105,[[]]],[11,"init","","",105,[[]]],[11,"deref","","",105,[[]]],[11,"deref_mut","","",105,[[]]],[11,"drop","","",105,[[]]],[11,"from","","",77,[[]]],[11,"into","","",77,[[]]],[11,"borrow","","",77,[[]]],[11,"borrow_mut","","",77,[[]]],[11,"try_from","","",77,[[],["result",4]]],[11,"try_into","","",77,[[],["result",4]]],[11,"type_id","","",77,[[],["typeid",3]]],[11,"vzip","","",77,[[]]],[11,"init","","",77,[[]]],[11,"deref","","",77,[[]]],[11,"deref_mut","","",77,[[]]],[11,"drop","","",77,[[]]],[11,"from","bdk::wallet::export","",78,[[]]],[11,"into","","",78,[[]]],[11,"borrow","","",78,[[]]],[11,"borrow_mut","","",78,[[]]],[11,"try_from","","",78,[[],["result",4]]],[11,"try_into","","",78,[[],["result",4]]],[11,"type_id","","",78,[[],["typeid",3]]],[11,"vzip","","",78,[[]]],[11,"init","","",78,[[]]],[11,"deref","","",78,[[]]],[11,"deref_mut","","",78,[[]]],[11,"drop","","",78,[[]]],[11,"from","bdk::wallet::signer","",79,[[]]],[11,"into","","",79,[[]]],[11,"to_owned","","",79,[[]]],[11,"clone_into","","",79,[[]]],[11,"borrow","","",79,[[]]],[11,"borrow_mut","","",79,[[]]],[11,"try_from","","",79,[[],["result",4]]],[11,"try_into","","",79,[[],["result",4]]],[11,"type_id","","",79,[[],["typeid",3]]],[11,"vzip","","",79,[[]]],[11,"equivalent","","",79,[[]]],[11,"init","","",79,[[]]],[11,"deref","","",79,[[]]],[11,"deref_mut","","",79,[[]]],[11,"drop","","",79,[[]]],[11,"from","","",80,[[]]],[11,"into","","",80,[[]]],[11,"to_owned","","",80,[[]]],[11,"clone_into","","",80,[[]]],[11,"to_string","","",80,[[],["string",3]]],[11,"borrow","","",80,[[]]],[11,"borrow_mut","","",80,[[]]],[11,"try_from","","",80,[[],["result",4]]],[11,"try_into","","",80,[[],["result",4]]],[11,"type_id","","",80,[[],["typeid",3]]],[11,"vzip","","",80,[[]]],[11,"equivalent","","",80,[[]]],[11,"init","","",80,[[]]],[11,"deref","","",80,[[]]],[11,"deref_mut","","",80,[[]]],[11,"drop","","",80,[[]]],[11,"from","","",82,[[]]],[11,"into","","",82,[[]]],[11,"to_owned","","",82,[[]]],[11,"clone_into","","",82,[[]]],[11,"borrow","","",82,[[]]],[11,"borrow_mut","","",82,[[]]],[11,"try_from","","",82,[[],["result",4]]],[11,"try_into","","",82,[[],["result",4]]],[11,"type_id","","",82,[[],["typeid",3]]],[11,"vzip","","",82,[[]]],[11,"equivalent","","",82,[[]]],[11,"init","","",82,[[]]],[11,"deref","","",82,[[]]],[11,"deref_mut","","",82,[[]]],[11,"drop","","",82,[[]]],[11,"from","","",83,[[]]],[11,"into","","",83,[[]]],[11,"to_owned","","",83,[[]]],[11,"clone_into","","",83,[[]]],[11,"borrow","","",83,[[]]],[11,"borrow_mut","","",83,[[]]],[11,"try_from","","",83,[[],["result",4]]],[11,"try_into","","",83,[[],["result",4]]],[11,"type_id","","",83,[[],["typeid",3]]],[11,"vzip","","",83,[[]]],[11,"init","","",83,[[]]],[11,"deref","","",83,[[]]],[11,"deref_mut","","",83,[[]]],[11,"drop","","",83,[[]]],[11,"from","bdk::wallet::tx_builder","",106,[[]]],[11,"into","","",106,[[]]],[11,"to_owned","","",106,[[]]],[11,"clone_into","","",106,[[]]],[11,"borrow","","",106,[[]]],[11,"borrow_mut","","",106,[[]]],[11,"try_from","","",106,[[],["result",4]]],[11,"try_into","","",106,[[],["result",4]]],[11,"type_id","","",106,[[],["typeid",3]]],[11,"vzip","","",106,[[]]],[11,"init","","",106,[[]]],[11,"deref","","",106,[[]]],[11,"deref_mut","","",106,[[]]],[11,"drop","","",106,[[]]],[11,"from","","",107,[[]]],[11,"into","","",107,[[]]],[11,"to_owned","","",107,[[]]],[11,"clone_into","","",107,[[]]],[11,"borrow","","",107,[[]]],[11,"borrow_mut","","",107,[[]]],[11,"try_from","","",107,[[],["result",4]]],[11,"try_into","","",107,[[],["result",4]]],[11,"type_id","","",107,[[],["typeid",3]]],[11,"vzip","","",107,[[]]],[11,"init","","",107,[[]]],[11,"deref","","",107,[[]]],[11,"deref_mut","","",107,[[]]],[11,"drop","","",107,[[]]],[11,"from","","",84,[[]]],[11,"into","","",84,[[]]],[11,"borrow","","",84,[[]]],[11,"borrow_mut","","",84,[[]]],[11,"try_from","","",84,[[],["result",4]]],[11,"try_into","","",84,[[],["result",4]]],[11,"type_id","","",84,[[],["typeid",3]]],[11,"vzip","","",84,[[]]],[11,"init","","",84,[[]]],[11,"deref","","",84,[[]]],[11,"deref_mut","","",84,[[]]],[11,"drop","","",84,[[]]],[11,"from","","",85,[[]]],[11,"into","","",85,[[]]],[11,"to_owned","","",85,[[]]],[11,"clone_into","","",85,[[]]],[11,"borrow","","",85,[[]]],[11,"borrow_mut","","",85,[[]]],[11,"try_from","","",85,[[],["result",4]]],[11,"try_into","","",85,[[],["result",4]]],[11,"type_id","","",85,[[],["typeid",3]]],[11,"vzip","","",85,[[]]],[11,"equivalent","","",85,[[]]],[11,"init","","",85,[[]]],[11,"deref","","",85,[[]]],[11,"deref_mut","","",85,[[]]],[11,"drop","","",85,[[]]],[11,"from","","",86,[[]]],[11,"into","","",86,[[]]],[11,"to_owned","","",86,[[]]],[11,"clone_into","","",86,[[]]],[11,"borrow","","",86,[[]]],[11,"borrow_mut","","",86,[[]]],[11,"try_from","","",86,[[],["result",4]]],[11,"try_into","","",86,[[],["result",4]]],[11,"type_id","","",86,[[],["typeid",3]]],[11,"vzip","","",86,[[]]],[11,"equivalent","","",86,[[]]],[11,"init","","",86,[[]]],[11,"deref","","",86,[[]]],[11,"deref_mut","","",86,[[]]],[11,"drop","","",86,[[]]],[11,"from","bdk::wallet","",88,[[]]],[11,"into","","",88,[[]]],[11,"borrow","","",88,[[]]],[11,"borrow_mut","","",88,[[]]],[11,"try_from","","",88,[[],["result",4]]],[11,"try_into","","",88,[[],["result",4]]],[11,"type_id","","",88,[[],["typeid",3]]],[11,"vzip","","",88,[[]]],[11,"init","","",88,[[]]],[11,"deref","","",88,[[]]],[11,"deref_mut","","",88,[[]]],[11,"drop","","",88,[[]]],[11,"from_str","bdk::descriptor","",23,[[],[["result",4],["descriptor",4],["error",4]]]],[11,"from_str","bdk::keys","",59,[[],[["result",4],["descriptorsecretkey",4]]]],[11,"from_str","","",58,[[],[["descriptorpublickey",4],["result",4]]]],[11,"from_str","bdk::descriptor","Parse a Miniscript from string and perform sanity checks …",24,[[],[["miniscript",3],["result",4],["error",4]]]],[11,"hash","bdk::keys","",58,[[]]],[11,"hash","","",61,[[]]],[11,"hash","bdk::descriptor","",27,[[]]],[11,"hash","","",24,[[]]],[11,"eq","","",27,[[["terminal",4]]]],[11,"ne","","",27,[[["terminal",4]]]],[11,"eq","bdk::keys","",58,[[["descriptorpublickey",4]]]],[11,"ne","","",58,[[["descriptorpublickey",4]]]],[11,"eq","bdk::descriptor","",101,[[["legacy",4]]]],[11,"eq","","",24,[[["miniscript",3]]]],[11,"eq","","",23,[[["descriptor",4]]]],[11,"ne","","",23,[[["descriptor",4]]]],[11,"eq","bdk::keys","",61,[[["descriptorsinglepub",3]]]],[11,"ne","","",61,[[["descriptorsinglepub",3]]]],[11,"eq","bdk::descriptor","",102,[[["segwitv0",4]]]],[11,"eq","bdk::keys","",62,[[["sortedmultivec",3]]]],[11,"ne","","",62,[[["sortedmultivec",3]]]],[11,"cmp","bdk::descriptor","",101,[[["legacy",4]],["ordering",4]]],[11,"cmp","bdk::keys","",61,[[["descriptorsinglepub",3]],["ordering",4]]],[11,"cmp","","",62,[[["sortedmultivec",3]],["ordering",4]]],[11,"cmp","bdk::descriptor","",24,[[["miniscript",3]],["ordering",4]]],[11,"cmp","","",102,[[["segwitv0",4]],["ordering",4]]],[11,"cmp","","",23,[[["descriptor",4]],["ordering",4]]],[11,"cmp","bdk::keys","",58,[[["descriptorpublickey",4]],["ordering",4]]],[11,"cmp","bdk::descriptor","",27,[[["terminal",4]],["ordering",4]]],[11,"check_terminal_non_malleable","","",101,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_witness","","",101,[[],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_consensus_validity","","",101,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_consensus_validity","","",101,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_policy_validity","","",101,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"max_satisfaction_size","","",101,[[["miniscript",3]],["option",4]]],[11,"check_terminal_non_malleable","","",102,[[["terminal",4]],[["scriptcontexterror",4],["result",4]]]],[11,"check_witness","","",102,[[],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_consensus_validity","","",102,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_consensus_validity","","",102,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_global_policy_validity","","",102,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"check_local_policy_validity","","",102,[[["miniscript",3]],[["scriptcontexterror",4],["result",4]]]],[11,"max_satisfaction_size","","",102,[[["miniscript",3]],["option",4]]],[11,"clone","","",102,[[],["segwitv0",4]]],[11,"clone","","",24,[[],["miniscript",3]]],[11,"clone","bdk::keys","",62,[[],["sortedmultivec",3]]],[11,"clone","bdk::descriptor","",27,[[],["terminal",4]]],[11,"clone","bdk::keys","",61,[[],["descriptorsinglepub",3]]],[11,"clone","bdk::descriptor","",23,[[],["descriptor",4]]],[11,"clone","","",101,[[],["legacy",4]]],[11,"clone","bdk::keys","",58,[[],["descriptorpublickey",4]]],[11,"fmt","bdk::descriptor","",27,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",60,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::descriptor","",102,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",58,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","","",62,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::descriptor","",23,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",59,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::descriptor","",24,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","","",101,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",61,[[["formatter",3]],[["error",3],["result",4]]]],[11,"to_pubkeyhash","","",58,[[],["descriptorpublickey",4]]],[11,"partial_cmp","","",58,[[["descriptorpublickey",4]],[["option",4],["ordering",4]]]],[11,"lt","","",58,[[["descriptorpublickey",4]]]],[11,"le","","",58,[[["descriptorpublickey",4]]]],[11,"gt","","",58,[[["descriptorpublickey",4]]]],[11,"ge","","",58,[[["descriptorpublickey",4]]]],[11,"partial_cmp","","",62,[[["sortedmultivec",3]],[["option",4],["ordering",4]]]],[11,"lt","","",62,[[["sortedmultivec",3]]]],[11,"le","","",62,[[["sortedmultivec",3]]]],[11,"gt","","",62,[[["sortedmultivec",3]]]],[11,"ge","","",62,[[["sortedmultivec",3]]]],[11,"partial_cmp","bdk::descriptor","",102,[[["segwitv0",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",24,[[["miniscript",3]],[["option",4],["ordering",4]]]],[11,"partial_cmp","bdk::keys","",61,[[["descriptorsinglepub",3]],[["option",4],["ordering",4]]]],[11,"lt","","",61,[[["descriptorsinglepub",3]]]],[11,"le","","",61,[[["descriptorsinglepub",3]]]],[11,"gt","","",61,[[["descriptorsinglepub",3]]]],[11,"ge","","",61,[[["descriptorsinglepub",3]]]],[11,"partial_cmp","bdk::descriptor","",101,[[["legacy",4]],[["option",4],["ordering",4]]]],[11,"partial_cmp","","",23,[[["descriptor",4]],[["option",4],["ordering",4]]]],[11,"lt","","",23,[[["descriptor",4]]]],[11,"le","","",23,[[["descriptor",4]]]],[11,"gt","","",23,[[["descriptor",4]]]],[11,"ge","","",23,[[["descriptor",4]]]],[11,"partial_cmp","","",27,[[["terminal",4]],[["option",4],["ordering",4]]]],[11,"lt","","",27,[[["terminal",4]]]],[11,"le","","",27,[[["terminal",4]]]],[11,"gt","","",27,[[["terminal",4]]]],[11,"ge","","",27,[[["terminal",4]]]],[11,"lift","bdk::keys","",62,[[],[["result",4],["policy",4],["error",4]]]],[11,"lift","bdk::descriptor","",24,[[],[["result",4],["policy",4],["error",4]]]],[11,"lift","","",23,[[],[["result",4],["policy",4],["error",4]]]],[11,"lift","","",27,[[],[["result",4],["policy",4],["error",4]]]],[11,"to_public_key","bdk::keys","",58,[[["descriptorpublickeyctx",3]],["publickey",3]]],[11,"hash_to_hash160","","",58,[[["descriptorpublickeyctx",3]],["hash",3]]],[11,"fmt","bdk::descriptor","",24,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","","",23,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",62,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::descriptor","",27,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","bdk::keys","",59,[[["formatter",3]],[["error",3],["result",4]]]],[11,"fmt","","",58,[[["formatter",3]],[["error",3],["result",4]]]],[11,"from_tree","bdk::descriptor","",27,[[["tree",3]],[["result",4],["terminal",4],["error",4]]]],[11,"from_tree","","Parse an expression tree into a Miniscript. As a general …",24,[[["tree",3]],[["miniscript",3],["result",4],["error",4]]]],[11,"from_tree","","Parse an expression tree into a descriptor",23,[[["tree",3]],[["result",4],["descriptor",4],["error",4]]]],[11,"from_config","bdk::blockchain::any","",0,[[],[["result",4],["error",4]]]],[11,"from_config","bdk::blockchain::electrum","",95,[[],[["result",4],["error",4]]]],[11,"from_config","bdk::blockchain::esplora","",3,[[],[["result",4],["error",4]]]],[11,"from_config","bdk::blockchain::compact_filters","",6,[[],[["result",4],["error",4]]]],[11,"update","bdk::blockchain","",99,[[["string",3],["option",4]],[["error",4],["result",4]]]],[11,"update","","",100,[[["string",3],["option",4]],[["error",4],["result",4]]]],[11,"set_script_pubkey","bdk::database::any","",14,[[["script",3],["keychainkind",4]],[["error",4],["result",4]]]],[11,"set_utxo","","",14,[[["utxo",3]],[["error",4],["result",4]]]],[11,"set_raw_tx","","",14,[[["transaction",3]],[["error",4],["result",4]]]],[11,"set_tx","","",14,[[["transactiondetails",3]],[["error",4],["result",4]]]],[11,"set_last_index","","",14,[[["keychainkind",4]],[["error",4],["result",4]]]],[11,"del_script_pubkey_from_path","","",14,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"del_path_from_script_pubkey","","",14,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"del_utxo","","",14,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"del_raw_tx","","",14,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"del_tx","","",14,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"del_last_index","","",14,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"set_script_pubkey","","",15,[[["script",3],["keychainkind",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,[[["keychainkind",4]],[["error",4],["result",4]]]],[11,"del_script_pubkey_from_path","","",15,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"del_path_from_script_pubkey","","",15,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"del_utxo","","",15,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"del_raw_tx","","",15,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"del_tx","","",15,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"del_last_index","","",15,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"set_script_pubkey","bdk::database::memory","",18,[[["script",3],["keychainkind",4]],[["error",4],["result",4]]]],[11,"set_utxo","","",18,[[["utxo",3]],[["error",4],["result",4]]]],[11,"set_raw_tx","","",18,[[["transaction",3]],[["error",4],["result",4]]]],[11,"set_tx","","",18,[[["transactiondetails",3]],[["error",4],["result",4]]]],[11,"set_last_index","","",18,[[["keychainkind",4]],[["error",4],["result",4]]]],[11,"del_script_pubkey_from_path","","",18,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"del_path_from_script_pubkey","","",18,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"del_utxo","","",18,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"del_raw_tx","","",18,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"del_tx","","",18,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"del_last_index","","",18,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"check_descriptor_checksum","bdk::database::any","",14,[[["asref",8],["keychainkind",4]],[["error",4],["result",4]]]],[11,"iter_script_pubkeys","","",14,[[["option",4],["keychainkind",4]],[["vec",3],["result",4],["error",4]]]],[11,"iter_utxos","","",14,[[],[["result",4],["vec",3],["error",4]]]],[11,"iter_raw_txs","","",14,[[],[["vec",3],["result",4],["error",4]]]],[11,"iter_txs","","",14,[[],[["error",4],["result",4],["vec",3]]]],[11,"get_script_pubkey_from_path","","",14,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"get_path_from_script_pubkey","","",14,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"get_utxo","","",14,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"get_raw_tx","","",14,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"get_tx","","",14,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"get_last_index","","",14,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"increment_last_index","","",14,[[["keychainkind",4]],[["result",4],["error",4]]]],[11,"check_descriptor_checksum","bdk::database::memory","",18,[[["asref",8],["keychainkind",4]],[["error",4],["result",4]]]],[11,"iter_script_pubkeys","","",18,[[["option",4],["keychainkind",4]],[["vec",3],["result",4],["error",4]]]],[11,"iter_utxos","","",18,[[],[["result",4],["vec",3],["error",4]]]],[11,"iter_raw_txs","","",18,[[],[["vec",3],["result",4],["error",4]]]],[11,"iter_txs","","",18,[[],[["error",4],["result",4],["vec",3]]]],[11,"get_script_pubkey_from_path","","",18,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"get_path_from_script_pubkey","","",18,[[["script",3]],[["error",4],["result",4],["option",4]]]],[11,"get_utxo","","",18,[[["outpoint",3]],[["result",4],["option",4],["error",4]]]],[11,"get_raw_tx","","",18,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"get_tx","","",18,[[["txid",3]],[["option",4],["result",4],["error",4]]]],[11,"get_last_index","","",18,[[["keychainkind",4]],[["result",4],["option",4],["error",4]]]],[11,"increment_last_index","","",18,[[["keychainkind",4]],[["result",4],["error",4]]]],[11,"begin_batch","bdk::database::any","",14,[[]]],[11,"commit_batch","","",14,[[],[["error",4],["result",4]]]],[11,"begin_batch","bdk::database::memory","",18,[[]]],[11,"commit_batch","","",18,[[],[["error",4],["result",4]]]],[11,"from_config","bdk::database::any","",14,[[],[["result",4],["error",4]]]],[11,"from_config","bdk::database::memory","",18,[[],[["result",4],["error",4]]]],[11,"build","bdk::descriptor::template","",47,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",48,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",49,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",50,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",51,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",52,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",53,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",54,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"build","","",55,[[],[["descriptortemplateout",6],["result",4],["keyerror",4]]]],[11,"to_wallet_descriptor","bdk","",108,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"to_wallet_descriptor","","",109,[[["network",4]],[["result",4],["keyerror",4]]]],[11,"extract_policy","bdk::descriptor","",24,[[["signerscontainer",3],["secp256k1",3]],[["result",4],["error",4],["option",4]]]],[11,"extract_policy","","",23,[[["signerscontainer",3],["secp256k1",3]],[["result",4],["error",4],["option",4]]]],[11,"to_descriptor_key","bdk::keys","",68,[[],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"to_descriptor_key","","",63,[[],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"to_descriptor_key","","",58,[[],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"to_descriptor_key","","",59,[[],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"add_metadata","bdk","",110,[[["keysource",6],["derivationpath",3],["option",4]],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"add_metadata","bdk::keys","",68,[[["keysource",6],["derivationpath",3],["option",4]],[["result",4],["descriptorkey",4],["keyerror",4]]]],[11,"coin_select","bdk::wallet::coin_selection","",105,[[["feerate",3],["vec",3]],[["result",4],["error",4],["coinselectionresult",3]]]],[11,"coin_select","","",77,[[["feerate",3],["vec",3]],[["result",4],["error",4],["coinselectionresult",3]]]],[11,"get_capabilities","bdk::blockchain::any","",0,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",0,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"sync","","",0,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"get_tx","","",0,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"broadcast","","",0,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",0,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",0,[[],[["feerate",3],["error",4],["result",4]]]],[11,"get_capabilities","bdk::blockchain::electrum","",95,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",95,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"get_tx","","",95,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"broadcast","","",95,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",95,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",95,[[],[["feerate",3],["error",4],["result",4]]]],[11,"get_capabilities","bdk::blockchain::esplora","",3,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",3,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"get_tx","","",3,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"broadcast","","",3,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",3,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",3,[[],[["feerate",3],["error",4],["result",4]]]],[11,"get_capabilities","bdk::blockchain::compact_filters","",6,[[],[["hashset",3],["capability",4]]]],[11,"setup","","",6,[[["progress",8],["option",4]],[["error",4],["result",4]]]],[11,"get_tx","","",6,[[["txid",3]],[["result",4],["option",4],["error",4]]]],[11,"broadcast","","",6,[[["transaction",3]],[["error",4],["result",4]]]],[11,"get_height","","",6,[[],[["result",4],["error",4]]]],[11,"estimate_fee","","",6,[[],[["feerate",3],["error",4],["result",4]]]],[11,"as_ref","bdk","",92,[[]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["addressvalidatorerror",4]]]],[11,"from","","",89,[[["policyerror",4]]]],[11,"from","","",89,[[["signererror",4]]]],[11,"from","","",89,[[["keyerror",4]],["error",4]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",3]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["esploraerror",4]]]],[11,"from","","",89,[[["error",4]]]],[11,"from","","",89,[[["compactfilterserror",4]]]],[11,"from","bdk::blockchain::any","",0,[[["electrumblockchain",3]]]],[11,"from","","",0,[[["esplorablockchain",3]]]],[11,"from","","",0,[[["compactfiltersblockchain",3]]]],[11,"from","","",1,[[["electrumblockchainconfig",3]]]],[11,"from","","",1,[[["esplorablockchainconfig",3]]]],[11,"from","","",1,[[["compactfiltersblockchainconfig",3]]]],[11,"from","bdk::blockchain::electrum","",95,[[["client",3]]]],[11,"from","bdk::blockchain::esplora","",5,[[["error",3]]]],[11,"from","","",5,[[["parseinterror",3]]]],[11,"from","","",5,[[["error",4]]]],[11,"from","","",5,[[["error",4]]]],[11,"from","bdk::blockchain::compact_filters","",9,[[["error",3]]]],[11,"from","","",9,[[["error",3]]]],[11,"from","","",9,[[["error",4]]]],[11,"from","","",9,[[["systemtimeerror",3]]]],[11,"from","","",9,[[["error",4]]]],[11,"from","bdk::database::any","",14,[[["memorydatabase",3]]]],[11,"from","","",14,[[["tree",3]]]],[11,"from","","",15,[[]]],[11,"from","","",15,[[]]],[11,"from","","",17,[[]]],[11,"from","","",17,[[["sleddbconfiguration",3]]]],[11,"from","bdk::descriptor::error","",29,[[["keyerror",4]],["error",4]]],[11,"from","","",29,[[["error",4]]]],[11,"from","","",29,[[["error",4]]]],[11,"from","","",29,[[["error",4]]]],[11,"from","","",29,[[["error",4]]]],[11,"from","","",29,[[["error",4]]]],[11,"from","","",29,[[["policyerror",4]]]],[11,"from","bdk::descriptor::policy","",39,[[]]],[11,"from","","",43,[[["satisfiableitem",4]]]],[11,"from","bdk::keys","",72,[[["error",4]]]],[11,"from","","",72,[[["error",4]]]],[11,"from","bdk::wallet::signer","",79,[[["hash",3]],["signerid",4]]],[11,"from","","",79,[[["fingerprint",3]],["signerid",4]]],[11,"from","","",83,[[["keymap",6]],["signerscontainer",3]]],[11,"clone","bdk::blockchain","",10,[[],["capability",4]]],[11,"clone","","",99,[[],["noopprogress",3]]],[11,"clone","","",100,[[],["logprogress",3]]],[11,"clone","bdk::descriptor::policy","",103,[[],["pkorf",3]]],[11,"clone","","",30,[[],["satisfiableitem",4]]],[11,"clone","","",39,[[],["satisfaction",4]]],[11,"clone","","",43,[[],["policy",3]]],[11,"clone","","",44,[[],["condition",3]]],[11,"clone","bdk::keys","",64,[[],["scriptcontextenum",4]]],[11,"clone","","",71,[[],["privatekeygenerateoptions",3]]],[11,"clone","bdk","",92,[[],["keychainkind",4]]],[11,"clone","","",104,[[],["feerate",3]]],[11,"clone","","",93,[[],["utxo",3]]],[11,"clone","","",94,[[],["transactiondetails",3]]],[11,"clone","bdk::wallet::address_validator","",73,[[],["addressvalidatorerror",4]]],[11,"clone","bdk::wallet::signer","",79,[[],["signerid",4]]],[11,"clone","","",80,[[],["signererror",4]]],[11,"clone","","",82,[[],["signerordering",3]]],[11,"clone","","",83,[[],["signerscontainer",3]]],[11,"clone","bdk::wallet::tx_builder","",106,[[],["createtx",3]]],[11,"clone","","",107,[[],["bumpfee",3]]],[11,"clone","","",85,[[],["txordering",4]]],[11,"clone","","",86,[[],["changespendpolicy",4]]],[11,"default","bdk::blockchain::compact_filters","",96,[[],["mempool",3]]],[11,"default","bdk::database::memory","",18,[[],["memorydatabase",3]]],[11,"default","bdk::descriptor::policy","",103,[[],["pkorf",3]]],[11,"default","","",44,[[],["condition",3]]],[11,"default","bdk::keys","",71,[[]]],[11,"default","bdk","",104,[[]]],[11,"default","","",94,[[],["transactiondetails",3]]],[11,"default","bdk::wallet::coin_selection","",105,[[],["largestfirstcoinselection",3]]],[11,"default","","",77,[[]]],[11,"default","bdk::wallet::signer","",82,[[]]],[11,"default","","",83,[[],["signerscontainer",3]]],[11,"default","bdk::wallet::tx_builder","",106,[[],["createtx",3]]],[11,"default","","",107,[[],["bumpfee",3]]],[11,"default","","",84,[[]]],[11,"default","","",85,[[]]],[11,"default","","",86,[[]]],[11,"cmp","bdk::descriptor::policy","",44,[[["condition",3]],["ordering",4]]],[11,"cmp","bdk::wallet::signer","",79,[[["signerid",4]],["ordering",4]]],[11,"cmp","","",82,[[["signerordering",3]],["ordering",4]]],[11,"cmp","bdk::wallet::tx_builder","",85,[[["txordering",4]],["ordering",4]]],[11,"cmp","","",86,[[["changespendpolicy",4]],["ordering",4]]],[11,"eq","bdk::blockchain","",10,[[["capability",4]]]],[11,"eq","bdk::descriptor::policy","",44,[[["condition",3]]]],[11,"ne","","",44,[[["condition",3]]]],[11,"eq","bdk::keys","",64,[[["scriptcontextenum",4]]]],[11,"eq","bdk","",92,[[["keychainkind",4]]]],[11,"eq","","",104,[[["feerate",3]]]],[11,"ne","","",104,[[["feerate",3]]]],[11,"eq","","",93,[[["utxo",3]]]],[11,"ne","","",93,[[["utxo",3]]]],[11,"eq","","",94,[[["transactiondetails",3]]]],[11,"ne","","",94,[[["transactiondetails",3]]]],[11,"eq","bdk::wallet::address_validator","",73,[[["addressvalidatorerror",4]]]],[11,"ne","","",73,[[["addressvalidatorerror",4]]]],[11,"eq","bdk::wallet::signer","",79,[[["signerid",4]]]],[11,"ne","","",79,[[["signerid",4]]]],[11,"eq","","",80,[[["signererror",4]]]],[11,"eq","","",82,[[["signerordering",3]]]],[11,"ne","","",82,[[["signerordering",3]]]],[11,"eq","bdk::wallet::tx_builder","",85,[[["txordering",4]]]],[11,"eq","","",86,[[["changespendpolicy",4]]]],[11,"partial_cmp","bdk::descriptor::policy","",44,[[["condition",3]],[["ordering",4],["option",4]]]],[11,"lt","","",44,[[["condition",3]]]],[11,"le","","",44,[[["condition",3]]]],[11,"gt","","",44,[[["condition",3]]]],[11,"ge","","",44,[[["condition",3]]]],[11,"partial_cmp","bdk","",104,[[["feerate",3]],[["ordering",4],["option",4]]]],[11,"lt","","",104,[[["feerate",3]]]],[11,"le","","",104,[[["feerate",3]]]],[11,"gt","","",104,[[["feerate",3]]]],[11,"ge","","",104,[[["feerate",3]]]],[11,"partial_cmp","bdk::wallet::signer","",79,[[["signerid",4]],[["ordering",4],["option",4]]]],[11,"lt","","",79,[[["signerid",4]]]],[11,"le","","",79,[[["signerid",4]]]],[11,"gt","","",79,[[["signerid",4]]]],[11,"ge","","",79,[[["signerid",4]]]],[11,"partial_cmp","","",82,[[["signerordering",3]],[["ordering",4],["option",4]]]],[11,"lt","","",82,[[["signerordering",3]]]],[11,"le","","",82,[[["signerordering",3]]]],[11,"gt","","",82,[[["signerordering",3]]]],[11,"ge","","",82,[[["signerordering",3]]]],[11,"partial_cmp","bdk::wallet::tx_builder","",85,[[["txordering",4]],[["ordering",4],["option",4]]]],[11,"partial_cmp","","",86,[[["changespendpolicy",4]],[["ordering",4],["option",4]]]],[11,"to_string","bdk::wallet::export","",78,[[],["string",3]]],[11,"deref","bdk::keys","",68,[[]]],[11,"fmt","bdk","",89,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::any","",1,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::electrum","",2,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::esplora","",3,[[["formatter",3]],["result",6]]],[11,"fmt","","",4,[[["formatter",3]],["result",6]]],[11,"fmt","","",5,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::compact_filters","",96,[[["formatter",3]],["result",6]]],[11,"fmt","","",97,[[["formatter",3]],["result",6]]],[11,"fmt","","",6,[[["formatter",3]],["result",6]]],[11,"fmt","","",7,[[["formatter",3]],["result",6]]],[11,"fmt","","",8,[[["formatter",3]],["result",6]]],[11,"fmt","","",9,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain","",10,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::database::any","",14,[[["formatter",3]],["result",6]]],[11,"fmt","","",16,[[["formatter",3]],["result",6]]],[11,"fmt","","",17,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::database::memory","",18,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::error","",29,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::policy","",103,[[["formatter",3]],["result",6]]],[11,"fmt","","",30,[[["formatter",3]],["result",6]]],[11,"fmt","","",39,[[["formatter",3]],["result",6]]],[11,"fmt","","",43,[[["formatter",3]],["result",6]]],[11,"fmt","","",44,[[["formatter",3]],["result",6]]],[11,"fmt","","",45,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::keys","",63,[[["formatter",3]],["result",6]]],[11,"fmt","","",64,[[["formatter",3]],["result",6]]],[11,"fmt","","",71,[[["formatter",3]],["result",6]]],[11,"fmt","","",72,[[["formatter",3]],["result",6]]],[11,"fmt","bdk","",92,[[["formatter",3]],["result",6]]],[11,"fmt","","",104,[[["formatter",3]],["result",6]]],[11,"fmt","","",93,[[["formatter",3]],["result",6]]],[11,"fmt","","",94,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::address_validator","",73,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::coin_selection","",75,[[["formatter",3]],["result",6]]],[11,"fmt","","",105,[[["formatter",3]],["result",6]]],[11,"fmt","","",77,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::export","",78,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::signer","",79,[[["formatter",3]],["result",6]]],[11,"fmt","","",80,[[["formatter",3]],["result",6]]],[11,"fmt","","",82,[[["formatter",3]],["result",6]]],[11,"fmt","","",83,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::tx_builder","",106,[[["formatter",3]],["result",6]]],[11,"fmt","","",107,[[["formatter",3]],["result",6]]],[11,"fmt","","",84,[[["formatter",3]],["result",6]]],[11,"fmt","","",85,[[["formatter",3]],["result",6]]],[11,"fmt","","",86,[[["formatter",3]],["result",6]]],[11,"fmt","bdk","",89,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::esplora","",5,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::blockchain::compact_filters","",9,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::error","",29,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::descriptor::policy","",45,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::keys","",72,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::address_validator","",73,[[["formatter",3]],["result",6]]],[11,"fmt","bdk::wallet::signer","",80,[[["formatter",3]],["result",6]]],[11,"hash","bdk::blockchain","",10,[[]]],[11,"hash","bdk::descriptor::policy","",44,[[]]],[11,"hash","bdk","",92,[[]]],[11,"hash","bdk::wallet::signer","",79,[[]]],[11,"hash","bdk::wallet::tx_builder","",85,[[]]],[11,"hash","","",86,[[]]],[11,"from_str","bdk::wallet::export","",78,[[],["result",4]]],[11,"serialize","bdk::blockchain::any","",1,[[],["result",4]]],[11,"serialize","bdk::blockchain::electrum","",2,[[],["result",4]]],[11,"serialize","bdk::blockchain::esplora","",4,[[],["result",4]]],[11,"serialize","bdk::blockchain::compact_filters","",7,[[],["result",4]]],[11,"serialize","","",8,[[],["result",4]]],[11,"serialize","bdk::database::any","",16,[[],["result",4]]],[11,"serialize","","",17,[[],["result",4]]],[11,"serialize","bdk::descriptor::policy","",103,[[],["result",4]]],[11,"serialize","","",30,[[],["result",4]]],[11,"serialize","","",39,[[],["result",4]]],[11,"serialize","","",43,[[],["result",4]]],[11,"serialize","","",44,[[],["result",4]]],[11,"serialize","bdk","",92,[[],["result",4]]],[11,"serialize","","",93,[[],["result",4]]],[11,"serialize","","",94,[[],["result",4]]],[11,"serialize","bdk::wallet::export","",78,[[],["result",4]]],[11,"deserialize","bdk::blockchain::any","",1,[[],["result",4]]],[11,"deserialize","bdk::blockchain::electrum","",2,[[],["result",4]]],[11,"deserialize","bdk::blockchain::esplora","",4,[[],["result",4]]],[11,"deserialize","bdk::blockchain::compact_filters","",7,[[],["result",4]]],[11,"deserialize","","",8,[[],["result",4]]],[11,"deserialize","bdk::database::any","",16,[[],["result",4]]],[11,"deserialize","","",17,[[],["result",4]]],[11,"deserialize","bdk","",92,[[],["result",4]]],[11,"deserialize","","",93,[[],["result",4]]],[11,"deserialize","","",94,[[],["result",4]]],[11,"deserialize","bdk::wallet::export","",78,[[],["result",4]]],[11,"add_tx","bdk::blockchain::compact_filters","Add a transaction to the mempool",96,[[["transaction",3]]]],[11,"get_tx","","Look-up a transaction in the mempool given an [<code>Inventory</code>] …",96,[[["inventory",4]],[["option",4],["transaction",3]]]],[11,"has_tx","","Return whether or not the mempool contains a transaction …",96,[[["txid",3]]]],[11,"iter_txs","","Return the list of transactions contained in the mempool",96,[[],[["vec",3],["transaction",3]]]],[11,"connect","","Connect to a peer over a plaintext TCP connection",97,[[["tosocketaddrs",8],["network",4],["arc",3],["mempool",3]],[["compactfilterserror",4],["result",4]]]],[11,"connect_proxy","","Connect to a peer through a SOCKS5 proxy, optionally by …",97,[[["tosocketaddrs",8],["totargetaddr",8],["option",4],["network",4],["arc",3],["mempool",3]],[["compactfilterserror",4],["result",4]]]],[11,"get_version","","Return the [<code>VersionMessage</code>] sent by the peer",97,[[],["versionmessage",3]]],[11,"get_network","","Return the Bitcoin [<code>Network</code>] in use",97,[[],["network",4]]],[11,"get_mempool","","Return the mempool used by this peer",97,[[],[["arc",3],["mempool",3]]]],[11,"is_connected","","Return whether or not the peer is still connected",97,[[]]],[11,"send","","Send a raw Bitcoin message to the peer",97,[[["networkmessage",4]],[["result",4],["compactfilterserror",4]]]],[11,"recv","","Waits for a specific incoming Bitcoin message, optionally …",97,[[["duration",3],["option",4]],[["option",4],["compactfilterserror",4],["result",4]]]],[11,"translate_pk","bdk::descriptor","Convert a descriptor using abstract keys to one using …",23,[[],[["descriptor",4],["result",4]]]],[11,"sanity_check","","Whether the descriptor is safe Checks whether all the …",23,[[],[["error",4],["result",4]]]],[11,"address","","Computes the Bitcoin address of the descriptor, if one …",23,[[["network",4]],[["address",3],["option",4]]]],[11,"script_pubkey","","Computes the scriptpubkey of the descriptor <code>to_pk_ctx</code> …",23,[[],["script",3]]],[11,"unsigned_script_sig","","Computes the scriptSig that will be in place for an …",23,[[],["script",3]]],[11,"witness_script","","Computes the \\\"witness script\\\" of the descriptor, i.e. the …",23,[[],["script",3]]],[11,"get_satisfication","","Returns satisfying witness and scriptSig to spend an …",23,[[],[["error",4],["result",4]]]],[11,"satisfy","","Attempts to produce a satisfying witness and scriptSig to …",23,[[["txin",3]],[["error",4],["result",4]]]],[11,"max_satisfaction_weight","","Computes an upper bound on the weight of a satisfying …",23,[[],["option",4]]],[11,"script_code","","Get the <code>scriptCode</code> of a transaction output.",23,[[],["script",3]]],[11,"derive","","Derives all wildcard keys in the descriptor using the …",23,[[["childnumber",4]],[["descriptorpublickey",4],["descriptor",4]]]],[11,"parse_descriptor","","Parse a descriptor that may contain secret keys",23,[[],[["error",4],["result",4]]]],[11,"to_string_with_secret","","Serialize a descriptor to string with its secret keys",23,[[["hashmap",3]],["string",3]]],[11,"requires_sig","","Whether all spend paths of miniscript require a signature",24,[[]]],[11,"is_non_malleable","","Whether the miniscript is malleable",24,[[]]],[11,"within_resource_limits","","Whether the miniscript can exceed the resource …",24,[[]]],[11,"has_mixed_timelocks","","Whether the miniscript contains a combination of timelocks",24,[[]]],[11,"has_repeated_keys","","Whether the miniscript has repeated Pk or Pkh",24,[[]]],[11,"sanity_check","","Check whether the underlying Miniscript is safe under the …",24,[[],[["result",4],["analysiserror",4]]]],[11,"iter","","Creates a new [Iter] iterator that will iterate over all […",24,[[],["iter",3]]],[11,"iter_pk","","Creates a new [PkIter] iterator that will iterate over …",24,[[],["pkiter",3]]],[11,"iter_pkh","","Creates a new [PkhIter] iterator that will iterate over …",24,[[],["pkhiter",3]]],[11,"iter_pk_pkh","","Creates a new [PkPkhIter] iterator that will iterate over …",24,[[],["pkpkhiter",3]]],[11,"branches","","Enumerates all child nodes of the current AST node (<code>self</code>) …",24,[[],[["miniscript",3],["global",3],["vec",3]]]],[11,"get_nth_child","","Returns child node with given index, if any",24,[[],[["miniscript",3],["option",4]]]],[11,"get_leaf_pk","","Returns <code>Vec</code> with cloned version of all public keys from …",24,[[],[["global",3],["vec",3]]]],[11,"get_leaf_pkh","","Returns <code>Vec</code> with hashes of all public keys from the …",24,[[],[["global",3],["vec",3]]]],[11,"get_leaf_pk_pkh","","Returns <code>Vec</code> of [PkPkh] entries, representing either …",24,[[],[["global",3],["vec",3],["pkpkh",4]]]],[11,"get_nth_pk","","Returns <code>Option::Some</code> with cloned n\'th public key from the …",24,[[],["option",4]]],[11,"get_nth_pkh","","Returns <code>Option::Some</code> with hash of n\'th public key from …",24,[[],["option",4]]],[11,"get_nth_pk_pkh","","Returns <code>Option::Some</code> with hash of n\'th public key or hash …",24,[[],[["option",4],["pkpkh",4]]]],[11,"from_ast","","Add type information(Type and Extdata) to Miniscript …",24,[[["terminal",4]],[["miniscript",3],["result",4],["error",4]]]],[11,"into_inner","","Extracts the <code>AstElem</code> representing the root of the …",24,[[],["terminal",4]]],[11,"as_inner","","Get a reference to the inner <code>AstElem</code> representing the …",24,[[],["terminal",4]]],[11,"parse_insane","","Attempt to parse an insane(scripts don\'t clear sanity …",24,[[["script",3]],[["result",4],["miniscript",3],["error",4]]]],[11,"parse","","Attempt to parse a Script into Miniscript representation. …",24,[[["script",3]],[["result",4],["miniscript",3],["error",4]]]],[11,"encode","","Encode as a Bitcoin script",24,[[],["script",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript …",24,[[]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the …",24,[[],["option",4]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For …",24,[[],["option",4]]],[11,"translate_pk","","This will panic if translatefpk returns an uncompressed …",24,[[],[["miniscript",3],["result",4]]]],[11,"from_str_insane","","Attempt to parse an insane(scripts don\'t clear sanity …",24,[[],[["miniscript",3],["result",4],["error",4]]]],[11,"satisfy","","Attempt to produce non-malleable satisfying witness for …",24,[[],[["vec",3],["result",4],["error",4]]]],[11,"satisfy_malleable","","Attempt to produce a malleable satisfying witness for the …",24,[[],[["vec",3],["result",4],["error",4]]]],[11,"lift_check","","Lifting corresponds conversion of miniscript into Policy […",24,[[],[["lifterror",4],["result",4]]]],[11,"translate_pk","","Convert an AST element with one public key type to one of …",27,[[],[["terminal",4],["result",4]]]],[11,"encode","","Encode the element as a fragment of Bitcoin Script. The …",27,[[["builder",3]],["builder",3]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript …",27,[[]]],[11,"derive","bdk::keys","Derives the specified child key if self is a wildcard …",58,[[["childnumber",4]],["descriptorpublickey",4]]],[11,"as_public","","Return the public version of this key, by applying either …",59,[[["secp256k1",3]],[["result",4],["descriptorpublickey",4],["descriptorkeyparseerror",3]]]],[11,"new","","Create a new instance of <code>SortedMultiVec</code> given a list of …",62,[[["global",3],["vec",3]],[["error",4],["sortedmultivec",3],["result",4]]]],[11,"translate_pk","","This will panic if translatefpk returns an uncompressed …",62,[[],[["result",4],["sortedmultivec",3]]]],[11,"sorted_node","","Create Terminal::Multi containing sorted pubkeys",62,[[],["terminal",4]]],[11,"encode","","Encode as a Bitcoin script",62,[[],["script",3]]],[11,"satisfy","","Attempt to produce a satisfying witness for the witness …",62,[[],[["vec",3],["result",4],["error",4]]]],[11,"script_size","","Size, in bytes of the script-pubkey. If this Miniscript …",62,[[]]],[11,"max_satisfaction_witness_elements","","Maximum number of witness elements used to satisfy the …",62,[[]]],[11,"max_satisfaction_size","","Maximum size, in bytes, of a satisfying witness. For …",62,[[]]],[11,"as_byte","bdk","Return [<code>KeychainKind</code>] as a byte",92,[[]]],[11,"from_btc_per_kvb","","Create a new instance of [<code>FeeRate</code>] given a float fee rate …",104,[[]]],[11,"from_sat_per_vb","","Create a new instance of [<code>FeeRate</code>] given a float fee rate …",104,[[]]],[11,"default_min_relay_fee","","Create a new [<code>FeeRate</code>] with the default min relay fee …",104,[[]]],[11,"as_sat_vb","","Return the value as satoshi/vbyte",104,[[]]]],"p":[[4,"AnyBlockchain"],[4,"AnyBlockchainConfig"],[3,"ElectrumBlockchainConfig"],[3,"EsploraBlockchain"],[3,"EsploraBlockchainConfig"],[4,"EsploraError"],[3,"CompactFiltersBlockchain"],[3,"BitcoinPeerConfig"],[3,"CompactFiltersBlockchainConfig"],[4,"CompactFiltersError"],[4,"Capability"],[8,"Blockchain"],[8,"ConfigurableBlockchain"],[8,"Progress"],[4,"AnyDatabase"],[4,"AnyBatch"],[3,"SledDbConfiguration"],[4,"AnyDatabaseConfig"],[3,"MemoryDatabase"],[8,"BatchOperations"],[8,"Database"],[8,"BatchDatabase"],[8,"ConfigurableDatabase"],[4,"Descriptor"],[3,"Miniscript"],[8,"MiniscriptKey"],[8,"ScriptContext"],[4,"Terminal"],[8,"ToPublicKey"],[4,"Error"],[4,"SatisfiableItem"],[13,"SHA256Preimage"],[13,"HASH256Preimage"],[13,"RIPEMD160Preimage"],[13,"HASH160Preimage"],[13,"AbsoluteTimelock"],[13,"RelativeTimelock"],[13,"Multisig"],[13,"Thresh"],[4,"Satisfaction"],[13,"Partial"],[13,"PartialComplete"],[13,"Complete"],[3,"Policy"],[3,"Condition"],[4,"PolicyError"],[8,"DescriptorTemplate"],[3,"P2PKH"],[3,"P2WPKH_P2SH"],[3,"P2WPKH"],[3,"BIP44"],[3,"BIP44Public"],[3,"BIP49"],[3,"BIP49Public"],[3,"BIP84"],[3,"BIP84Public"],[8,"ToWalletDescriptor"],[8,"ExtractPolicy"],[4,"DescriptorPublicKey"],[4,"DescriptorSecretKey"],[3,"DescriptorSinglePriv"],[3,"DescriptorSinglePub"],[3,"SortedMultiVec"],[4,"DescriptorKey"],[4,"ScriptContextEnum"],[8,"ExtScriptContext"],[8,"ToDescriptorKey"],[8,"DerivableKey"],[3,"GeneratedKey"],[8,"GeneratableKey"],[8,"GeneratableDefaultOptions"],[3,"PrivateKeyGenerateOptions"],[4,"KeyError"],[4,"AddressValidatorError"],[8,"AddressValidator"],[3,"CoinSelectionResult"],[8,"CoinSelectionAlgorithm"],[3,"BranchAndBoundCoinSelection"],[3,"WalletExport"],[4,"SignerId"],[4,"SignerError"],[8,"Signer"],[3,"SignerOrdering"],[3,"SignersContainer"],[3,"TxBuilder"],[4,"TxOrdering"],[4,"ChangeSpendPolicy"],[8,"IsDust"],[3,"Wallet"],[4,"Error"],[13,"FeeRateTooLow"],[13,"FeeTooLow"],[4,"KeychainKind"],[3,"UTXO"],[3,"TransactionDetails"],[3,"ElectrumBlockchain"],[3,"Mempool"],[3,"Peer"],[3,"OfflineBlockchain"],[3,"NoopProgress"],[3,"LogProgress"],[4,"Legacy"],[4,"Segwitv0"],[3,"PKOrF"],[3,"FeeRate"],[3,"LargestFirstCoinSelection"],[3,"CreateTx"],[3,"BumpFee"],[6,"ExtendedDescriptor"],[6,"DescriptorTemplateOut"],[6,"MnemonicWithPassphrase"]]}\
+}');
+addSearchOptions(searchIndex);initSearch(searchIndex);
\ No newline at end of file
--- /dev/null
+.setting-line{padding:5px;position:relative;}.setting-line>div{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{opacity:0;position:absolute;}.select-wrapper{float:right;position:relative;height:27px;min-width:25%;}.select-wrapper select{appearance:none;-moz-appearance:none;-webkit-appearance:none;background:none;border:2px solid #ccc;padding-right:28px;width:100%;}.select-wrapper img{pointer-events:none;position:absolute;right:0;bottom:0;background:#ccc;height:100%;width:28px;padding:0px 4px;}.select-wrapper select option{color:initial;}.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 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}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="./light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="./dark.css" disabled ><link rel="stylesheet" type="text/css" href="./ayu.css" disabled ><link rel="stylesheet" type="text/css" href="./settings.css" ><script id="default-settings"></script><script src="./storage.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="./favicon.svg">
+<link rel="alternate icon" type="image/png" href="./favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="./favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="./brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">Theme preferences</div><div class="sub-settings"><div class="setting-line"><label class="toggle"><input type="checkbox" id="use-system-theme" checked><span class="slider"></span></label><div>Use system theme</div></div><div class="setting-line"><div>Preferred dark theme</div><label class="select-wrapper"><select id="preferred-dark-theme" autocomplete="off"><option value="light" >light</option><option value="dark" selected>dark</option><option value="ayu" >ayu</option></select><img src="./down-arrow.svg" alt="Select item"></label></div><div class="setting-line"><div>Preferred light theme</div><label class="select-wrapper"><select id="preferred-light-theme" autocomplete="off"><option value="light" selected>light</option><option value="dark" >dark</option><option value="ayu" >ayu</option></select><img src="./down-arrow.svg" alt="Select item"></label></div></div>
+ </div><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 implementation documentation</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="auto-collapse-implementors" checked><span class="slider"></span></label><div>Auto-hide implementors of a trait</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,value){updateLocalStorage("rustdoc-"+settingName,value);switch(settingName){case"preferred-dark-theme":case"preferred-light-theme":case"use-system-theme":updateSystemTheme();break}}function handleKey(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return}switch(getVirtualKey(ev)){case"Enter":case"Return":case"Space":ev.target.checked=!ev.target.checked;ev.preventDefault();break}}function setEvents(){onEachLazy(document.getElementsByClassName("slider"),function(elem){var toggle=elem.previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)};toggle.onkeyup=handleKey;toggle.onkeyrelease=handleKey});onEachLazy(document.getElementsByClassName("select-wrapper"),function(elem){var select=elem.getElementsByTagName("select")[0];var settingId=select.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){select.value=settingValue}select.onchange=function(){changeSetting(this.id,this.value)}})}window.addEventListener("DOMContentLoaded",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":["any.rs","electrum.rs","esplora.rs","mod.rs","utils.rs"]},{"name":"database","files":["any.rs","keyvalue.rs","memory.rs","mod.rs"]},{"name":"descriptor","files":["checksum.rs","dsl.rs","error.rs","mod.rs","policy.rs","template.rs"]},{"name":"keys","files":["bip39.rs","mod.rs"]},{"name":"psbt","files":["mod.rs"]},{"name":"wallet","files":["address_validator.rs","coin_selection.rs","export.rs","mod.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);var selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}
\ 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 of the Rust file `src/blockchain/any.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>any.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! Runtime-checked blockchain types</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the implementation of [`AnyBlockchain`] which allows switching the</span>
+<span class="doccomment">//! inner [`Blockchain`] type at runtime.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! In this example both `wallet_electrum` and `wallet_esplora` have the same type of</span>
+<span class="doccomment">//! `Wallet<AnyBlockchain, MemoryDatabase>`. This means that they could both, for instance, be</span>
+<span class="doccomment">//! assigned to a struct member.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bitcoin::Network;</span>
+<span class="doccomment">//! # use bdk::blockchain::*;</span>
+<span class="doccomment">//! # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//! # use bdk::Wallet;</span>
+<span class="doccomment">//! # #[cfg(feature = "electrum")]</span>
+<span class="doccomment">//! # {</span>
+<span class="doccomment">//! let electrum_blockchain = ElectrumBlockchain::from(electrum_client::Client::new("...")?);</span>
+<span class="doccomment">//! let wallet_electrum: Wallet<AnyBlockchain, _> = Wallet::new(</span>
+<span class="doccomment">//! "...",</span>
+<span class="doccomment">//! None,</span>
+<span class="doccomment">//! Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! electrum_blockchain.into(),</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # #[cfg(feature = "esplora")]</span>
+<span class="doccomment">//! # {</span>
+<span class="doccomment">//! let esplora_blockchain = EsploraBlockchain::new("...", None);</span>
+<span class="doccomment">//! let wallet_esplora: Wallet<AnyBlockchain, _> = Wallet::new(</span>
+<span class="doccomment">//! "...",</span>
+<span class="doccomment">//! None,</span>
+<span class="doccomment">//! Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! esplora_blockchain.into(),</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! When paired with the use of [`ConfigurableBlockchain`], it allows creating wallets with any</span>
+<span class="doccomment">//! blockchain type supported using a single line of code:</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bitcoin::Network;</span>
+<span class="doccomment">//! # use bdk::blockchain::*;</span>
+<span class="doccomment">//! # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//! # use bdk::Wallet;</span>
+<span class="doccomment">//! let config = serde_json::from_str("...")?;</span>
+<span class="doccomment">//! let blockchain = AnyBlockchain::from_config(&config)?;</span>
+<span class="doccomment">//! let wallet = Wallet::new(</span>
+<span class="doccomment">//! "...",</span>
+<span class="doccomment">//! None,</span>
+<span class="doccomment">//! Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! blockchain,</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_from</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">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">variant</span>:<span class="ident">ident</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">cfg</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">cfg</span> )<span class="op">*</span>
+ <span class="kw">impl</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="macro-nonterminal">$</span><span class="macro-nonterminal">to</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">inner</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="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span><span class="op">></span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">variant</span>(<span class="ident">inner</span>)
+ }
+ }
+ };
+}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_inner_method</span> {
+ ( <span class="macro-nonterminal">$</span><span class="self">self</span>:<span class="macro-nonterminal">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>:<span class="ident">ident</span> $(, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>:<span class="ident">expr</span>)<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="self">self</span> {
+ <span class="attribute">#[<span class="macro-nonterminal">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>)]</span>
+ <span class="ident">AnyBlockchain</span>::<span class="ident">Electrum</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>( $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>, )<span class="op">*</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">AnyBlockchain</span>::<span class="ident">Esplora</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>( $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>, )<span class="op">*</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">AnyBlockchain</span>::<span class="ident">CompactFilters</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>( $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>, )<span class="op">*</span> ),
+ }
+ }
+}
+
+<span class="doccomment">/// Type that can contain any of the [`Blockchain`] types defined by the library</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// It allows switching backend at runtime</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [this module](crate::blockchain::any)'s documentation for a usage example.</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AnyBlockchain</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="doccomment">/// Electrum client</span>
+ <span class="ident">Electrum</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="doccomment">/// Esplora client</span>
+ <span class="ident">Esplora</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="doccomment">/// Compact filters client</span>
+ <span class="ident">CompactFilters</span>(<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchain</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">AnyBlockchain</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="self">self</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="macro">impl_inner_method</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="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="macro">impl_inner_method</span><span class="macro">!</span>(
+ <span class="self">self</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="self">self</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="self">self</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="self">self</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="self">self</span>, <span class="ident">estimate_fee</span>, <span class="ident">target</span>))
+ }
+}
+
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchain</span>, <span class="ident">AnyBlockchain</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="macro">impl_from</span><span class="macro">!</span>(<span class="ident">esplora</span>::<span class="ident">EsploraBlockchain</span>, <span class="ident">AnyBlockchain</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="macro">impl_from</span><span class="macro">!</span>(<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchain</span>, <span class="ident">AnyBlockchain</span>, <span class="ident">CompactFilters</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="doccomment">/// Type that can contain any of the blockchain configurations defined by the library</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This allows storing a single configuration that can be loaded into an [`AnyBlockchain`]</span>
+<span class="doccomment">/// instance. Wallets that plan to offer users the ability to switch blockchain backend at runtime</span>
+<span class="doccomment">/// will find this particularly useful.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AnyBlockchainConfig</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="doccomment">/// Electrum client</span>
+ <span class="ident">Electrum</span>(<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchainConfig</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="doccomment">/// Esplora client</span>
+ <span class="ident">Esplora</span>(<span class="ident">esplora</span>::<span class="ident">EsploraBlockchainConfig</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="doccomment">/// Compact filters client</span>
+ <span class="ident">CompactFilters</span>(<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchainConfig</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">ConfigurableBlockchain</span> <span class="kw">for</span> <span class="ident">AnyBlockchain</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">AnyBlockchainConfig</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="prelude-val">Ok</span>(<span class="kw">match</span> <span class="ident">config</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">AnyBlockchainConfig</span>::<span class="ident">Electrum</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">AnyBlockchain</span>::<span class="ident">Electrum</span>(<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchain</span>::<span class="ident">from_config</span>(<span class="ident">inner</span>)<span class="question-mark">?</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">AnyBlockchainConfig</span>::<span class="ident">Esplora</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">AnyBlockchain</span>::<span class="ident">Esplora</span>(<span class="ident">esplora</span>::<span class="ident">EsploraBlockchain</span>::<span class="ident">from_config</span>(<span class="ident">inner</span>)<span class="question-mark">?</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">AnyBlockchainConfig</span>::<span class="ident">CompactFilters</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">AnyBlockchain</span>::<span class="ident">CompactFilters</span>(
+ <span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchain</span>::<span class="ident">from_config</span>(<span class="ident">inner</span>)<span class="question-mark">?</span>,
+ ),
+ })
+ }
+}
+
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="ident">electrum</span>::<span class="ident">ElectrumBlockchainConfig</span>, <span class="ident">AnyBlockchainConfig</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="macro">impl_from</span><span class="macro">!</span>(<span class="ident">esplora</span>::<span class="ident">EsploraBlockchainConfig</span>, <span class="ident">AnyBlockchainConfig</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="macro">impl_from</span><span class="macro">!</span>(<span class="ident">compact_filters</span>::<span class="ident">CompactFiltersBlockchainConfig</span>, <span class="ident">AnyBlockchainConfig</span>, <span class="ident">CompactFilters</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>);
+</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 of the Rust file `src/blockchain/compact_filters/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><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 rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! This is an **EXPERIMENTAL** feature, API and other major changes are expected.</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(|_| {</span>
+<span class="doccomment">//! 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">//! })</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::<(), CompactFiltersError>(())</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">Network</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">ConfigurableBlockchain</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">KeychainKind</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">keychain</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">keychain</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">keychain</span> <span class="op">=</span><span class="op">=</span> <span class="ident">KeychainKind</span>::<span class="ident">Internal</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">keychain</span> <span class="op">=</span><span class="op">=</span> <span class="ident">KeychainKind</span>::<span class="ident">External</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">/// Data to connect to a Bitcoin P2P peer</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BitcoinPeerConfig</span> {
+ <span class="doccomment">/// Peer address such as 127.0.0.1:18333</span>
+ <span class="kw">pub</span> <span class="ident">address</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// Optional socks5 proxy</span>
+ <span class="kw">pub</span> <span class="ident">socks5</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
+ <span class="doccomment">/// Optional socks5 proxy credentials</span>
+ <span class="kw">pub</span> <span class="ident">socks5_credentials</span>: <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">String</span>, <span class="ident">String</span>)<span class="op">></span>,
+}
+
+<span class="doccomment">/// Configuration for a [`CompactFiltersBlockchain`]</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CompactFiltersBlockchainConfig</span> {
+ <span class="doccomment">/// List of peers to try to connect to for asking headers and filters</span>
+ <span class="kw">pub</span> <span class="ident">peers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">BitcoinPeerConfig</span><span class="op">></span>,
+ <span class="doccomment">/// Network used</span>
+ <span class="kw">pub</span> <span class="ident">network</span>: <span class="ident">Network</span>,
+ <span class="doccomment">/// Storage dir to save partially downloaded headers and full blocks</span>
+ <span class="kw">pub</span> <span class="ident">storage_dir</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// Optionally skip initial `skip_blocks` blocks (default: 0)</span>
+ <span class="kw">pub</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">ConfigurableBlockchain</span> <span class="kw">for</span> <span class="ident">CompactFiltersBlockchain</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">CompactFiltersBlockchainConfig</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="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="ident">config</span>
+ .<span class="ident">peers</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">peer_conf</span><span class="op">|</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">peer_conf</span>.<span class="ident">socks5</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Peer</span>::<span class="ident">connect</span>(<span class="kw-2">&</span><span class="ident">peer_conf</span>.<span class="ident">address</span>, <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>), <span class="ident">config</span>.<span class="ident">network</span>),
+ <span class="prelude-val">Some</span>(<span class="ident">proxy</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Peer</span>::<span class="ident">connect_proxy</span>(
+ <span class="ident">peer_conf</span>.<span class="ident">address</span>.<span class="ident">as_str</span>(),
+ <span class="ident">proxy</span>,
+ <span class="ident">peer_conf</span>
+ .<span class="ident">socks5_credentials</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">map</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">as_str</span>(), <span class="ident">b</span>.<span class="ident">as_str</span>())),
+ <span class="ident">Arc</span>::<span class="ident">clone</span>(<span class="kw-2">&</span><span class="ident">mempool</span>),
+ <span class="ident">config</span>.<span class="ident">network</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="prelude-val">Ok</span>(<span class="ident">CompactFiltersBlockchain</span>::<span class="ident">new</span>(
+ <span class="ident">peers</span>,
+ <span class="kw-2">&</span><span class="ident">config</span>.<span class="ident">storage_dir</span>,
+ <span class="ident">config</span>.<span class="ident">skip_blocks</span>,
+ )<span class="question-mark">?</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">impl_error</span><span class="macro">!</span>(<span class="ident">rocksdb</span>::<span class="ident">Error</span>, <span class="ident">DB</span>, <span class="ident">CompactFiltersError</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="ident">CompactFiltersError</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="ident">CompactFiltersError</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="ident">CompactFiltersError</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 of the Rust file `src/blockchain/compact_filters/peer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>peer.rs - 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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><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 rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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](bitcoin::network::message::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 of the Rust file `src/blockchain/compact_filters/store.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>store.rs - 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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><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 rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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 of the Rust file `src/blockchain/compact_filters/sync.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>sync.rs - 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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><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 rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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 of the Rust file `src/blockchain/electrum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>electrum.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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")?;</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">BlockHeader</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">ConfigBuilder</span>, <span class="ident">ElectrumApi</span>, <span class="ident">Socks5Config</span>};
+
+<span class="kw">use</span> <span class="self">self</span>::<span class="ident">utils</span>::{<span class="ident">ELSGetHistoryRes</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="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="ident">Clone</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_transaction_get</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">Txid</span><span class="op">></span> <span class="op">+</span> <span class="ident">Clone</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">txids</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">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">batch_transaction_get</span>(<span class="ident">txids</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_block_header</span><span class="op"><</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="ident">u32</span><span class="op">></span> <span class="op">+</span> <span class="ident">Clone</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">heights</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">BlockHeader</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">batch_block_header</span>(<span class="ident">heights</span>).<span class="ident">map_err</span>(<span class="ident">Error</span>::<span class="ident">Electrum</span>)
+ }
+}
+
+<span class="doccomment">/// Configuration for an [`ElectrumBlockchain`]</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ElectrumBlockchainConfig</span> {
+ <span class="doccomment">/// URL of the Electrum server (such as ElectrumX, Esplora, BWT) may start with `ssl://` or `tcp://` and include a port</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// eg. `ssl://electrum.blockstream.info:60002`</span>
+ <span class="kw">pub</span> <span class="ident">url</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// URL of the socks5 proxy server or a Tor service</span>
+ <span class="kw">pub</span> <span class="ident">socks5</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
+ <span class="doccomment">/// Request retry count</span>
+ <span class="kw">pub</span> <span class="ident">retry</span>: <span class="ident">u8</span>,
+ <span class="doccomment">/// Request timeout (seconds)</span>
+ <span class="kw">pub</span> <span class="ident">timeout</span>: <span class="ident">u8</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ConfigurableBlockchain</span> <span class="kw">for</span> <span class="ident">ElectrumBlockchain</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">ElectrumBlockchainConfig</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="ident">socks5</span> <span class="op">=</span> <span class="ident">config</span>.<span class="ident">socks5</span>.<span class="ident">as_ref</span>().<span class="ident">map</span>(<span class="ident">Socks5Config</span>::<span class="ident">new</span>);
+ <span class="kw">let</span> <span class="ident">electrum_config</span> <span class="op">=</span> <span class="ident">ConfigBuilder</span>::<span class="ident">new</span>()
+ .<span class="ident">retry</span>(<span class="ident">config</span>.<span class="ident">retry</span>)
+ .<span class="ident">socks5</span>(<span class="ident">socks5</span>)<span class="question-mark">?</span>
+ .<span class="ident">timeout</span>(<span class="ident">config</span>.<span class="ident">timeout</span>)<span class="question-mark">?</span>
+ .<span class="ident">build</span>();
+
+ <span class="prelude-val">Ok</span>(<span class="ident">ElectrumBlockchain</span>(<span class="ident">Client</span>::<span class="ident">from_config</span>(
+ <span class="ident">config</span>.<span class="ident">url</span>.<span class="ident">as_str</span>(),
+ <span class="ident">electrum_config</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 of the Rust file `src/blockchain/esplora.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>esplora.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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", None);</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">FuturesOrdered</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="self">self</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">FromHex</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">BlockHash</span>, <span class="ident">BlockHeader</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">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">wallet</span>::<span class="ident">utils</span>::<span class="ident">ChunksIterator</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">FeeRate</span>;
+
+<span class="kw">const</span> <span class="ident">DEFAULT_CONCURRENT_REQUESTS</span>: <span class="ident">u8</span> <span class="op">=</span> <span class="number">4</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="ident">concurrency</span>: <span class="ident">u8</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="ident">concurrency</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u8</span><span class="op">></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="ident">concurrency</span>: <span class="ident">concurrency</span>.<span class="ident">unwrap_or</span>(<span class="ident">DEFAULT_CONCURRENT_REQUESTS</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="ident">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="ident">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="ident">await</span><span class="question-mark">?</span>)<span class="question-mark">?</span>))
+ }
+
+ <span class="ident">async</span> <span class="kw">fn</span> <span class="ident">_get_tx_no_opt</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">EsploraError</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span>.<span class="ident">_get_tx</span>(<span class="ident">txid</span>).<span class="ident">await</span> {
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">tx</span>)) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">tx</span>),
+ <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">EsploraError</span>::<span class="ident">TransactionNotFound</span>(<span class="kw-2">*</span><span class="ident">txid</span>)),
+ <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">e</span>),
+ }
+ }
+
+ <span class="ident">async</span> <span class="kw">fn</span> <span class="ident">_get_header</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_height</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">BlockHeader</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">"{}/block-height/{}"</span>, <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">block_height</span>))
+ .<span class="ident">send</span>()
+ .<span class="ident">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">Err</span>(<span class="ident">EsploraError</span>::<span class="ident">HeaderHeightNotFound</span>(<span class="ident">block_height</span>));
+ }
+ <span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">bytes</span>().<span class="ident">await</span><span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">hash</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">from_utf8</span>(<span class="kw-2">&</span><span class="ident">bytes</span>)
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">EsploraError</span>::<span class="ident">HeaderHeightNotFound</span>(<span class="ident">block_height</span>))<span class="question-mark">?</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">"{}/block/{}/header"</span>, <span class="self">self</span>.<span class="ident">url</span>, <span class="ident">hash</span>))
+ .<span class="ident">send</span>()
+ .<span class="ident">await</span><span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">header</span> <span class="op">=</span> <span class="ident">deserialize</span>(<span class="kw-2">&</span><span class="ident">Vec</span>::<span class="ident">from_hex</span>(<span class="kw-2">&</span><span class="ident">resp</span>.<span class="ident">text</span>().<span class="ident">await</span><span class="question-mark">?</span>)<span class="question-mark">?</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">header</span>)
+ }
+
+ <span class="ident">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="ident">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="ident">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="ident">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="ident">await</span><span class="question-mark">?</span>.<span class="ident">parse</span>()<span class="question-mark">?</span>)
+ }
+
+ <span class="ident">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="ident">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="ident">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="ident">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="ident">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="ident">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="ident">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="ident">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="ident">async</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">results</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</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">scripts</span>.<span class="ident">into_iter</span>(), <span class="self">self</span>.<span class="ident">concurrency</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">futs</span> <span class="op">=</span> <span class="ident">FuturesOrdered</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">script</span> <span class="kw">in</span> <span class="ident">chunk</span> {
+ <span class="ident">futs</span>.<span class="ident">push</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="kw">let</span> <span class="ident">partial_results</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="op">=</span> <span class="ident">futs</span>.<span class="ident">try_collect</span>().<span class="ident">await</span><span class="question-mark">?</span>;
+ <span class="ident">results</span>.<span class="ident">extend</span>(<span class="ident">partial_results</span>);
+ }
+ <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">results</span>).<span class="ident">collect</span>().<span class="ident">await</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_transaction_get</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">Txid</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">txids</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">Transaction</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="ident">async</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">results</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</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">txids</span>.<span class="ident">into_iter</span>(), <span class="self">self</span>.<span class="ident">concurrency</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">futs</span> <span class="op">=</span> <span class="ident">FuturesOrdered</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">txid</span> <span class="kw">in</span> <span class="ident">chunk</span> {
+ <span class="ident">futs</span>.<span class="ident">push</span>(<span class="self">self</span>.<span class="ident">_get_tx_no_opt</span>(<span class="kw-2">&</span><span class="ident">txid</span>));
+ }
+ <span class="kw">let</span> <span class="ident">partial_results</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></span> <span class="op">=</span> <span class="ident">futs</span>.<span class="ident">try_collect</span>().<span class="ident">await</span><span class="question-mark">?</span>;
+ <span class="ident">results</span>.<span class="ident">extend</span>(<span class="ident">partial_results</span>);
+ }
+ <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">results</span>).<span class="ident">collect</span>().<span class="ident">await</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_block_header</span><span class="op"><</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="ident">u32</span><span class="op">></span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">heights</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">BlockHeader</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="ident">async</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">results</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</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">heights</span>.<span class="ident">into_iter</span>(), <span class="self">self</span>.<span class="ident">concurrency</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">futs</span> <span class="op">=</span> <span class="ident">FuturesOrdered</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">height</span> <span class="kw">in</span> <span class="ident">chunk</span> {
+ <span class="ident">futs</span>.<span class="ident">push</span>(<span class="self">self</span>.<span class="ident">_get_header</span>(<span class="ident">height</span>));
+ }
+ <span class="kw">let</span> <span class="ident">partial_results</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="ident">futs</span>.<span class="ident">try_collect</span>().<span class="ident">await</span><span class="question-mark">?</span>;
+ <span class="ident">results</span>.<span class="ident">extend</span>(<span class="ident">partial_results</span>);
+ }
+ <span class="prelude-val">Ok</span>(<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="ident">results</span>).<span class="ident">collect</span>().<span class="ident">await</span>)
+ };
+
+ <span class="macro">await_or_block</span><span class="macro">!</span>(<span class="ident">future</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="doccomment">/// Configuration for an [`EsploraBlockchain`]</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">EsploraBlockchainConfig</span> {
+ <span class="doccomment">/// Base URL of the esplora service</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// eg. `https://blockstream.info/api/`</span>
+ <span class="kw">pub</span> <span class="ident">base_url</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// Number of parallel requests sent to the esplora service (default: 4)</span>
+ <span class="kw">pub</span> <span class="ident">concurrency</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ConfigurableBlockchain</span> <span class="kw">for</span> <span class="ident">EsploraBlockchain</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">EsploraBlockchainConfig</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="prelude-val">Ok</span>(<span class="ident">EsploraBlockchain</span>::<span class="ident">new</span>(
+ <span class="ident">config</span>.<span class="ident">base_url</span>.<span class="ident">as_str</span>(),
+ <span class="ident">config</span>.<span class="ident">concurrency</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">/// Invalid Hex data returned</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="doccomment">/// Transaction not found</span>
+ <span class="ident">TransactionNotFound</span>(<span class="ident">Txid</span>),
+ <span class="doccomment">/// Header height not found</span>
+ <span class="ident">HeaderHeightNotFound</span>(<span class="ident">u32</span>),
+ <span class="doccomment">/// Header hash not found</span>
+ <span class="ident">HeaderHashNotFound</span>(<span class="ident">BlockHash</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="macro">impl_error</span><span class="macro">!</span>(<span class="ident">reqwest</span>::<span class="ident">Error</span>, <span class="ident">Reqwest</span>, <span class="ident">EsploraError</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>, <span class="ident">Parsing</span>, <span class="ident">EsploraError</span>);
+<span class="macro">impl_error</span><span class="macro">!</span>(<span class="ident">consensus</span>::<span class="ident">encode</span>::<span class="ident">Error</span>, <span class="ident">BitcoinEncoding</span>, <span class="ident">EsploraError</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="ident">EsploraError</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 of the Rust file `src/blockchain/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</span>))]</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">any</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</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">any</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">any</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"electrum"</span>, <span class="ident">feature</span> <span class="op">=</span> <span class="string">"esplora"</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="ident">any</span>::{<span class="ident">AnyBlockchain</span>, <span class="ident">AnyBlockchainConfig</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">"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">ElectrumBlockchainConfig</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 [`BlockchainMarker`] 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">/// Trait for [`Blockchain`] types that can be created given a configuration</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ConfigurableBlockchain</span>: <span class="ident">Blockchain</span> <span class="op">+</span> <span class="ident">Sized</span> {
+ <span class="doccomment">/// Type that contains the configuration</span>
+ <span class="kw">type</span> <span class="ident">Config</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span>;
+
+ <span class="doccomment">/// Create a new instance given a configuration</span>
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="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_else</span>(<span class="op">|</span><span class="op">|</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 of the Rust file `src/blockchain/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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="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">rand</span>::<span class="ident">seq</span>::<span class="ident">SliceRandom</span>;
+<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">thread_rng</span>;
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">BlockHeader</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">KeychainKind</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">time</span>::<span class="ident">Instant</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="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="ident">Clone</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_transaction_get</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">Txid</span><span class="op">></span> <span class="op">+</span> <span class="ident">Clone</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">txids</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">Transaction</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span>;
+
+ <span class="kw">fn</span> <span class="ident">els_batch_block_header</span><span class="op"><</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="ident">u32</span><span class="op">></span> <span class="op">+</span> <span class="ident">Clone</span><span class="op">></span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">heights</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">BlockHeader</span><span class="op">></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">db</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">start</span> <span class="op">=</span> <span class="ident">Instant</span>::<span class="ident">new</span>();
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"start setup"</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">chunk_size</span> <span class="op">=</span> <span class="ident">stop_gap</span>;
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">history_txs_id</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">txid_height</span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">max_indexes</span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wallet_chains</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">KeychainKind</span>::<span class="ident">Internal</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>];
+ <span class="comment">// shuffling improve privacy, the server doesn't know my first request is from my internal or external addresses</span>
+ <span class="ident">wallet_chains</span>.<span class="ident">shuffle</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">thread_rng</span>());
+ <span class="comment">// download history of our internal and external script_pubkeys</span>
+ <span class="kw">for</span> <span class="ident">keychain</span> <span class="kw">in</span> <span class="ident">wallet_chains</span>.<span class="ident">iter</span>() {
+ <span class="kw">let</span> <span class="ident">script_iter</span> <span class="op">=</span> <span class="ident">db</span>.<span class="ident">iter_script_pubkeys</span>(<span class="prelude-val">Some</span>(<span class="kw-2">*</span><span class="ident">keychain</span>))<span class="question-mark">?</span>.<span class="ident">into_iter</span>();
+
+ <span class="kw">for</span> (<span class="ident">i</span>, <span class="ident">chunk</span>) <span class="kw">in</span> <span class="ident">ChunksIterator</span>::<span class="ident">new</span>(<span class="ident">script_iter</span>, <span class="ident">stop_gap</span>).<span class="ident">enumerate</span>() {
+ <span class="comment">// TODO if i == last, should create another chunk of addresses in db</span>
+ <span class="kw">let</span> <span class="ident">call_result</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="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">let</span> <span class="ident">max_index</span> <span class="op">=</span> <span class="ident">call_result</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">enumerate</span>()
+ .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">i</span>, <span class="ident">v</span>)<span class="op">|</span> <span class="ident">v</span>.<span class="ident">first</span>().<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>))
+ .<span class="ident">max</span>();
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">max</span>) <span class="op">=</span> <span class="ident">max_index</span> {
+ <span class="ident">max_indexes</span>.<span class="ident">insert</span>(<span class="ident">keychain</span>, <span class="ident">max</span> <span class="op">+</span> (<span class="ident">i</span> <span class="op">*</span> <span class="ident">chunk_size</span>) <span class="kw">as</span> <span class="ident">u32</span>);
+ }
+ <span class="kw">let</span> <span class="ident">flattened</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">call_result</span>.<span class="ident">into_iter</span>().<span class="ident">flatten</span>().<span class="ident">collect</span>();
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"#{} of {:?} results:{}"</span>, <span class="ident">i</span>, <span class="ident">keychain</span>, <span class="ident">flattened</span>.<span class="ident">len</span>());
+ <span class="kw">if</span> <span class="ident">flattened</span>.<span class="ident">is_empty</span>() {
+ <span class="comment">// Didn't find anything in the last `stop_gap` script_pubkeys, breaking</span>
+ <span class="kw">break</span>;
+ }
+
+ <span class="kw">for</span> <span class="ident">el</span> <span class="kw">in</span> <span class="ident">flattened</span> {
+ <span class="comment">// el.height = -1 means unconfirmed with unconfirmed parents</span>
+ <span class="comment">// el.height = 0 means unconfirmed with confirmed parents</span>
+ <span class="comment">// but we treat those tx the same</span>
+ <span class="kw">if</span> <span class="ident">el</span>.<span class="ident">height</span> <span class="op"><</span><span class="op">=</span> <span class="number">0</span> {
+ <span class="ident">txid_height</span>.<span class="ident">insert</span>(<span class="ident">el</span>.<span class="ident">tx_hash</span>, <span class="prelude-val">None</span>);
+ } <span class="kw">else</span> {
+ <span class="ident">txid_height</span>.<span class="ident">insert</span>(<span class="ident">el</span>.<span class="ident">tx_hash</span>, <span class="prelude-val">Some</span>(<span class="ident">el</span>.<span class="ident">height</span> <span class="kw">as</span> <span class="ident">u32</span>));
+ }
+ <span class="ident">history_txs_id</span>.<span class="ident">insert</span>(<span class="ident">el</span>.<span class="ident">tx_hash</span>);
+ }
+ }
+ }
+
+ <span class="comment">// saving max indexes</span>
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"max indexes are: {:?}"</span>, <span class="ident">max_indexes</span>);
+ <span class="kw">for</span> <span class="ident">keychain</span> <span class="kw">in</span> <span class="ident">wallet_chains</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">index</span>) <span class="op">=</span> <span class="ident">max_indexes</span>.<span class="ident">get</span>(<span class="ident">keychain</span>) {
+ <span class="ident">db</span>.<span class="ident">set_last_index</span>(<span class="kw-2">*</span><span class="ident">keychain</span>, <span class="kw-2">*</span><span class="ident">index</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="comment">// get db status</span>
+ <span class="kw">let</span> <span class="ident">txs_details_in_db</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">TransactionDetails</span><span class="op">></span> <span class="op">=</span> <span class="ident">db</span>
+ .<span class="ident">iter_txs</span>(<span class="bool-val">false</span>)<span class="question-mark">?</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">txid</span>, <span class="ident">tx</span>))
+ .<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">txs_raw_in_db</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="ident">db</span>
+ .<span class="ident">iter_raw_txs</span>()<span class="question-mark">?</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">txid</span>(), <span class="ident">tx</span>))
+ .<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">utxos_deps</span> <span class="op">=</span> <span class="ident">utxos_deps</span>(<span class="ident">db</span>, <span class="kw-2">&</span><span class="ident">txs_raw_in_db</span>)<span class="question-mark">?</span>;
+
+ <span class="comment">// download new txs and headers</span>
+ <span class="kw">let</span> <span class="ident">new_txs</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">download_and_save_needed_raw_txs</span>(
+ <span class="kw-2">&</span><span class="ident">history_txs_id</span>,
+ <span class="kw-2">&</span><span class="ident">txs_raw_in_db</span>,
+ <span class="ident">chunk_size</span>,
+ <span class="ident">db</span>
+ ))<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">new_timestamps</span> <span class="op">=</span> <span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">download_needed_headers</span>(
+ <span class="kw-2">&</span><span class="ident">txid_height</span>,
+ <span class="kw-2">&</span><span class="ident">txs_details_in_db</span>,
+ <span class="ident">chunk_size</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">db</span>.<span class="ident">begin_batch</span>();
+
+ <span class="comment">// save any tx details not in db but in history_txs_id or with different height/timestamp</span>
+ <span class="kw">for</span> <span class="ident">txid</span> <span class="kw">in</span> <span class="ident">history_txs_id</span>.<span class="ident">iter</span>() {
+ <span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">txid_height</span>.<span class="ident">get</span>(<span class="ident">txid</span>).<span class="ident">cloned</span>().<span class="ident">flatten</span>();
+ <span class="kw">let</span> <span class="ident">timestamp</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">new_timestamps</span>.<span class="ident">get</span>(<span class="ident">txid</span>).<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="number">0u64</span>);
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">tx_details</span>) <span class="op">=</span> <span class="ident">txs_details_in_db</span>.<span class="ident">get</span>(<span class="ident">txid</span>) {
+ <span class="comment">// check if height matches, otherwise updates it</span>
+ <span class="kw">if</span> <span class="ident">tx_details</span>.<span class="ident">height</span> <span class="op">!</span><span class="op">=</span> <span class="ident">height</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_tx_details</span> <span class="op">=</span> <span class="ident">tx_details</span>.<span class="ident">clone</span>();
+ <span class="ident">new_tx_details</span>.<span class="ident">height</span> <span class="op">=</span> <span class="ident">height</span>;
+ <span class="ident">new_tx_details</span>.<span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">timestamp</span>;
+ <span class="ident">batch</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">new_tx_details</span>)<span class="question-mark">?</span>;
+ }
+ } <span class="kw">else</span> {
+ <span class="ident">save_transaction_details_and_utxos</span>(
+ <span class="kw-2">&</span><span class="ident">txid</span>,
+ <span class="ident">db</span>,
+ <span class="ident">timestamp</span>,
+ <span class="ident">height</span>,
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">batch</span>,
+ <span class="kw-2">&</span><span class="ident">utxos_deps</span>,
+ )<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="comment">// remove any tx details in db but not in history_txs_id</span>
+ <span class="kw">for</span> <span class="ident">txid</span> <span class="kw">in</span> <span class="ident">txs_details_in_db</span>.<span class="ident">keys</span>() {
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">history_txs_id</span>.<span class="ident">contains</span>(<span class="ident">txid</span>) {
+ <span class="ident">batch</span>.<span class="ident">del_tx</span>(<span class="kw-2">&</span><span class="ident">txid</span>, <span class="bool-val">false</span>)<span class="question-mark">?</span>;
+ }
+ }
+
+ <span class="comment">// remove any spent utxo</span>
+ <span class="kw">for</span> <span class="ident">new_tx</span> <span class="kw">in</span> <span class="ident">new_txs</span>.<span class="ident">iter</span>() {
+ <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="ident">new_tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>() {
+ <span class="ident">batch</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="ident">db</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"finish setup, elapsed {:?}ms"</span>, <span class="ident">start</span>.<span class="ident">elapsed</span>().<span class="ident">as_millis</span>());
+
+ <span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="doccomment">/// download txs identified by `history_txs_id` and theirs previous outputs if not already present in db</span>
+ <span class="kw">fn</span> <span class="ident">download_and_save_needed_raw_txs</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">history_txs_id</span>: <span class="kw-2">&</span><span class="ident">HashSet</span><span class="op"><</span><span class="ident">Txid</span><span class="op">></span>,
+ <span class="ident">txs_raw_in_db</span>: <span class="kw-2">&</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="ident">chunk_size</span>: <span class="ident">usize</span>,
+ <span class="ident">db</span>: <span class="kw-2">&</span><span class="kw-2">mut</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="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="kw-2">mut</span> <span class="ident">txs_downloaded</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ <span class="kw">let</span> <span class="ident">txids_raw_in_db</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Txid</span><span class="op">></span> <span class="op">=</span> <span class="ident">txs_raw_in_db</span>.<span class="ident">keys</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">txids_to_download</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Txid</span><span class="op">></span> <span class="op">=</span> <span class="ident">history_txs_id</span>.<span class="ident">difference</span>(<span class="kw-2">&</span><span class="ident">txids_raw_in_db</span>).<span class="ident">collect</span>();
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">txids_to_download</span>.<span class="ident">is_empty</span>() {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"got {} txs to download"</span>, <span class="ident">txids_to_download</span>.<span class="ident">len</span>());
+ <span class="ident">txs_downloaded</span>.<span class="ident">extend</span>(<span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">download_and_save_in_chunks</span>(
+ <span class="ident">txids_to_download</span>,
+ <span class="ident">chunk_size</span>,
+ <span class="ident">db</span>,
+ ))<span class="question-mark">?</span>);
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">prev_txids</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">txids_downloaded</span> <span class="op">=</span> <span class="ident">HashSet</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">tx</span> <span class="kw">in</span> <span class="ident">txs_downloaded</span>.<span class="ident">iter</span>() {
+ <span class="ident">txids_downloaded</span>.<span class="ident">insert</span>(<span class="ident">tx</span>.<span class="ident">txid</span>());
+ <span class="comment">// add every previous input tx, but skip coinbase</span>
+ <span class="kw">for</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">filter</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="op">!</span><span class="ident">i</span>.<span class="ident">previous_output</span>.<span class="ident">is_null</span>()) {
+ <span class="ident">prev_txids</span>.<span class="ident">insert</span>(<span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">txid</span>);
+ }
+ }
+ <span class="kw">let</span> <span class="ident">already_present</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Txid</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">txids_downloaded</span>.<span class="ident">union</span>(<span class="kw-2">&</span><span class="ident">txids_raw_in_db</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">prev_txs_to_download</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Txid</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">prev_txids</span>.<span class="ident">difference</span>(<span class="kw-2">&</span><span class="ident">already_present</span>).<span class="ident">collect</span>();
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"{} previous txs to download"</span>, <span class="ident">prev_txs_to_download</span>.<span class="ident">len</span>());
+ <span class="ident">txs_downloaded</span>.<span class="ident">extend</span>(<span class="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">download_and_save_in_chunks</span>(
+ <span class="ident">prev_txs_to_download</span>,
+ <span class="ident">chunk_size</span>,
+ <span class="ident">db</span>,
+ ))<span class="question-mark">?</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txs_downloaded</span>)
+ }
+
+ <span class="doccomment">/// download headers at heights in `txid_height` if tx details not already present, returns a map Txid -> timestamp</span>
+ <span class="kw">fn</span> <span class="ident">download_needed_headers</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">txid_height</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">Txid</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="ident">txs_details_in_db</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">TransactionDetails</span><span class="op">></span>,
+ <span class="ident">chunk_size</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">HashMap</span><span class="op"><</span><span class="ident">Txid</span>, <span class="ident">u64</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">txid_timestamp</span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">needed_txid_height</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Txid</span>, <span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="ident">txid_height</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span>(<span class="ident">t</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">txs_details_in_db</span>.<span class="ident">get</span>(<span class="kw-2">*</span><span class="ident">t</span>).<span class="ident">is_none</span>())
+ .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">t</span>, <span class="ident">o</span>)<span class="op">|</span> <span class="ident">o</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">h</span><span class="op">|</span> (<span class="ident">t</span>, <span class="ident">h</span>)))
+ .<span class="ident">collect</span>();
+ <span class="kw">let</span> <span class="ident">needed_heights</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="ident">needed_txid_height</span>.<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">needed_heights</span>.<span class="ident">is_empty</span>() {
+ <span class="macro">info</span><span class="macro">!</span>(<span class="string">"{} headers to download for timestamp"</span>, <span class="ident">needed_heights</span>.<span class="ident">len</span>());
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">height_timestamp</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">u32</span>, <span class="ident">u64</span><span class="op">></span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">new</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">needed_heights</span>.<span class="ident">into_iter</span>(), <span class="ident">chunk_size</span>) {
+ <span class="kw">let</span> <span class="ident">call_result</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="macro">maybe_await</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">els_batch_block_header</span>(<span class="ident">chunk</span>.<span class="ident">clone</span>()))<span class="question-mark">?</span>;
+ <span class="ident">height_timestamp</span>.<span class="ident">extend</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="ident">map</span>(<span class="op">|</span><span class="ident">h</span><span class="op">|</span> <span class="ident">h</span>.<span class="ident">time</span> <span class="kw">as</span> <span class="ident">u64</span>)),
+ );
+ }
+ <span class="kw">for</span> (<span class="ident">txid</span>, <span class="ident">height</span>) <span class="kw">in</span> <span class="ident">needed_txid_height</span> {
+ <span class="kw">let</span> <span class="ident">timestamp</span> <span class="op">=</span> <span class="ident">height_timestamp</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">height</span>)
+ .<span class="ident">ok_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">Error</span>::<span class="ident">Generic</span>(<span class="string">"timestamp missing"</span>.<span class="ident">to_string</span>()))<span class="question-mark">?</span>;
+ <span class="ident">txid_timestamp</span>.<span class="ident">insert</span>(<span class="kw-2">*</span><span class="ident">txid</span>, <span class="kw-2">*</span><span class="ident">timestamp</span>);
+ }
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txid_timestamp</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">download_and_save_in_chunks</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">to_download</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Txid</span><span class="op">></span>,
+ <span class="ident">chunk_size</span>: <span class="ident">usize</span>,
+ <span class="ident">db</span>: <span class="kw-2">&</span><span class="kw-2">mut</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="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="kw-2">mut</span> <span class="ident">txs_downloaded</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</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">to_download</span>.<span class="ident">into_iter</span>(), <span class="ident">chunk_size</span>) {
+ <span class="kw">let</span> <span class="ident">call_result</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Transaction</span><span class="op">></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_transaction_get</span>(<span class="ident">chunk</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">db</span>.<span class="ident">begin_batch</span>();
+ <span class="kw">for</span> <span class="ident">new_tx</span> <span class="kw">in</span> <span class="ident">call_result</span>.<span class="ident">iter</span>() {
+ <span class="ident">batch</span>.<span class="ident">set_raw_tx</span>(<span class="ident">new_tx</span>)<span class="question-mark">?</span>;
+ }
+ <span class="ident">db</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)<span class="question-mark">?</span>;
+ <span class="ident">txs_downloaded</span>.<span class="ident">extend</span>(<span class="ident">call_result</span>);
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">txs_downloaded</span>)
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">save_transaction_details_and_utxos</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="ident">txid</span>: <span class="kw-2">&</span><span class="ident">Txid</span>,
+ <span class="ident">db</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">timestamp</span>: <span class="ident">u64</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">updates</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">dyn</span> <span class="ident">BatchOperations</span>,
+ <span class="ident">utxo_deps</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">OutPoint</span>, <span class="ident">OutPoint</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="ident">tx</span> <span class="op">=</span> <span class="ident">db</span>.<span class="ident">get_raw_tx</span>(<span class="ident">txid</span>)<span class="question-mark">?</span>.<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>)<span class="question-mark">?</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">input</span> <span class="kw">in</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>() {
+ <span class="comment">// skip coinbase inputs</span>
+ <span class="kw">if</span> <span class="ident">input</span>.<span class="ident">previous_output</span>.<span class="ident">is_null</span>() {
+ <span class="kw">continue</span>;
+ }
+
+ <span class="comment">// We already downloaded all previous output txs in the previous step</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">db</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">db</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="kw">else</span> {
+ <span class="comment">// The input is not ours, but we still need to count it for the fees</span>
+ <span class="kw">let</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">db</span>
+ .<span class="ident">get_raw_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="question-mark">?</span>
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>)<span class="question-mark">?</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="comment">// removes conflicting UTXO if any (generated from same inputs, like for example RBF)</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">outpoint</span>) <span class="op">=</span> <span class="ident">utxo_deps</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">input</span>.<span class="ident">previous_output</span>) {
+ <span class="ident">updates</span>.<span class="ident">del_utxo</span>(<span class="kw-2">&</span><span class="ident">outpoint</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">keychain</span>, <span class="ident">_child</span>)) <span class="op">=</span> <span class="ident">db</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">keychain</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">let</span> <span class="ident">tx_details</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="ident">fees</span>: <span class="ident">inputs_sum</span>.<span class="ident">saturating_sub</span>(<span class="ident">outputs_sum</span>), <span class="comment">/* if the tx is a coinbase, fees would be negative */</span>
+ };
+ <span class="ident">updates</span>.<span class="ident">set_tx</span>(<span class="kw-2">&</span><span class="ident">tx_details</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(())
+}
+
+<span class="doccomment">/// returns utxo dependency as the inputs needed for the utxo to exist</span>
+<span class="doccomment">/// `tx_raw_in_db` must contains utxo's generating txs or errors witt [crate::Error::TransactionNotFound]</span>
+<span class="kw">fn</span> <span class="ident">utxos_deps</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">BatchDatabase</span><span class="op">></span>(
+ <span class="ident">db</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">D</span>,
+ <span class="ident">tx_raw_in_db</span>: <span class="kw-2">&</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="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">OutPoint</span>, <span class="ident">OutPoint</span><span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">db</span>.<span class="ident">iter_utxos</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">utxos_deps</span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">new</span>();
+ <span class="kw">for</span> <span class="ident">utxo</span> <span class="kw">in</span> <span class="ident">utxos</span> {
+ <span class="kw">let</span> <span class="ident">from_tx</span> <span class="op">=</span> <span class="ident">tx_raw_in_db</span>
+ .<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">utxo</span>.<span class="ident">outpoint</span>.<span class="ident">txid</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">TransactionNotFound</span>)<span class="question-mark">?</span>;
+ <span class="kw">for</span> <span class="ident">input</span> <span class="kw">in</span> <span class="ident">from_tx</span>.<span class="ident">input</span>.<span class="ident">iter</span>() {
+ <span class="ident">utxos_deps</span>.<span class="ident">insert</span>(<span class="ident">input</span>.<span class="ident">previous_output</span>, <span class="ident">utxo</span>.<span class="ident">outpoint</span>);
+ }
+ }
+ <span class="prelude-val">Ok</span>(<span class="ident">utxos_deps</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 of the Rust file `src/database/any.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>any.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! Runtime-checked database types</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module provides the implementation of [`AnyDatabase`] which allows switching the</span>
+<span class="doccomment">//! inner [`Database`] type at runtime.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Example</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! In this example, `wallet_memory` and `wallet_sled` have the same type of `Wallet<OfflineBlockchain, AnyDatabase>`.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bitcoin::Network;</span>
+<span class="doccomment">//! # use bdk::database::{AnyDatabase, MemoryDatabase};</span>
+<span class="doccomment">//! # use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">//! let memory = MemoryDatabase::default().into();</span>
+<span class="doccomment">//! let wallet_memory: OfflineWallet<AnyDatabase> =</span>
+<span class="doccomment">//! Wallet::new_offline("...", None, Network::Testnet, memory)?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # #[cfg(feature = "key-value-db")]</span>
+<span class="doccomment">//! # {</span>
+<span class="doccomment">//! let sled = sled::open("my-database")?.open_tree("default_tree")?.into();</span>
+<span class="doccomment">//! let wallet_sled: OfflineWallet<AnyDatabase> =</span>
+<span class="doccomment">//! Wallet::new_offline("...", None, Network::Testnet, sled)?;</span>
+<span class="doccomment">//! # }</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! When paired with the use of [`ConfigurableDatabase`], it allows creating wallets with any</span>
+<span class="doccomment">//! database supported using a single line of code:</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```no_run</span>
+<span class="doccomment">//! # use bitcoin::Network;</span>
+<span class="doccomment">//! # use bdk::database::*;</span>
+<span class="doccomment">//! # use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">//! let config = serde_json::from_str("...")?;</span>
+<span class="doccomment">//! let database = AnyDatabase::from_config(&config)?;</span>
+<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline("...", None, Network::Testnet, database)?;</span>
+<span class="doccomment">//! # Ok::<(), bdk::Error>(())</span>
+<span class="doccomment">//! ```</span>
+
+<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_from</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">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">variant</span>:<span class="ident">ident</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">cfg</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">cfg</span> )<span class="op">*</span>
+ <span class="kw">impl</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="macro-nonterminal">$</span><span class="macro-nonterminal">to</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">inner</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="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span><span class="op">></span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">variant</span>(<span class="ident">inner</span>)
+ }
+ }
+ };
+}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_inner_method</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">enum_name</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="self">self</span>:<span class="macro-nonterminal">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>:<span class="ident">ident</span> $(, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>:<span class="ident">expr</span>)<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="self">self</span> {
+ <span class="macro-nonterminal">$</span><span class="macro-nonterminal">enum_name</span>::<span class="ident">Memory</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>( $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>, )<span class="op">*</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-nonterminal">$</span><span class="macro-nonterminal">enum_name</span>::<span class="ident">Sled</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="macro-nonterminal">$</span><span class="macro-nonterminal">name</span>( $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>, )<span class="op">*</span> ),
+ }
+ }
+}
+
+<span class="doccomment">/// Type that can contain any of the [`Database`] types defined by the library</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// It allows switching database type at runtime.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [this module](crate::database::any)'s documentation 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">enum</span> <span class="ident">AnyDatabase</span> {
+ <span class="doccomment">/// In-memory ephemeral database</span>
+ <span class="ident">Memory</span>(<span class="ident">memory</span>::<span class="ident">MemoryDatabase</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="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">"key-value-db"</span>)))]</span>
+ <span class="doccomment">/// Simple key-value embedded database based on [`sled`]</span>
+ <span class="ident">Sled</span>(<span class="ident">sled</span>::<span class="ident">Tree</span>),
+}
+
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>, <span class="ident">AnyDatabase</span>, <span class="ident">Memory</span>,);
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="ident">sled</span>::<span class="ident">Tree</span>, <span class="ident">AnyDatabase</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">"key-value-db"</span>)]</span>);
+
+<span class="doccomment">/// Type that contains any of the [`BatchDatabase::Batch`] types defined by the library</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AnyBatch</span> {
+ <span class="doccomment">/// In-memory ephemeral database</span>
+ <span class="ident">Memory</span>(<span class="op"><</span><span class="ident">memory</span>::<span class="ident">MemoryDatabase</span> <span class="kw">as</span> <span class="ident">BatchDatabase</span><span class="op">></span>::<span class="ident">Batch</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="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">"key-value-db"</span>)))]</span>
+ <span class="doccomment">/// Simple key-value embedded database based on [`sled`]</span>
+ <span class="ident">Sled</span>(<span class="op"><</span><span class="ident">sled</span>::<span class="ident">Tree</span> <span class="kw">as</span> <span class="ident">BatchDatabase</span><span class="op">></span>::<span class="ident">Batch</span>),
+}
+
+<span class="macro">impl_from</span><span class="macro">!</span>(
+ <span class="op"><</span><span class="ident">memory</span>::<span class="ident">MemoryDatabase</span> <span class="kw">as</span> <span class="ident">BatchDatabase</span><span class="op">></span>::<span class="ident">Batch</span>,
+ <span class="ident">AnyBatch</span>,
+ <span class="ident">Memory</span>,
+);
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="op"><</span><span class="ident">sled</span>::<span class="ident">Tree</span> <span class="kw">as</span> <span class="ident">BatchDatabase</span><span class="op">></span>::<span class="ident">Batch</span>, <span class="ident">AnyBatch</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">"key-value-db"</span>)]</span>);
+
+<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">AnyDatabase</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(
+ <span class="ident">AnyDatabase</span>,
+ <span class="self">self</span>,
+ <span class="ident">set_script_pubkey</span>,
+ <span class="ident">script</span>,
+ <span class="ident">keychain</span>,
+ <span class="ident">child</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">set_utxo</span>, <span class="ident">utxo</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">set_raw_tx</span>, <span class="ident">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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">set_tx</span>, <span class="ident">transaction</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">set_last_index</span>, <span class="ident">keychain</span>, <span class="ident">value</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(
+ <span class="ident">AnyDatabase</span>,
+ <span class="self">self</span>,
+ <span class="ident">del_script_pubkey_from_path</span>,
+ <span class="ident">keychain</span>,
+ <span class="ident">child</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">KeychainKind</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">del_path_from_script_pubkey</span>, <span class="ident">script</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">del_utxo</span>, <span class="ident">outpoint</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">del_raw_tx</span>, <span class="ident">txid</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">del_tx</span>, <span class="ident">txid</span>, <span class="ident">include_raw</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">del_last_index</span>, <span class="ident">keychain</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">Database</span> <span class="kw">for</span> <span class="ident">AnyDatabase</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(
+ <span class="ident">AnyDatabase</span>,
+ <span class="self">self</span>,
+ <span class="ident">check_descriptor_checksum</span>,
+ <span class="ident">keychain</span>,
+ <span class="ident">bytes</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">keychain</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">KeychainKind</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">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">iter_script_pubkeys</span>, <span class="ident">keychain</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">iter_utxos</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">iter_raw_txs</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">iter_txs</span>, <span class="ident">include_raw</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(
+ <span class="ident">AnyDatabase</span>,
+ <span class="self">self</span>,
+ <span class="ident">get_script_pubkey_from_path</span>,
+ <span class="ident">keychain</span>,
+ <span class="ident">child</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">KeychainKind</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">get_path_from_script_pubkey</span>, <span class="ident">script</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">get_utxo</span>, <span class="ident">outpoint</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">get_raw_tx</span>, <span class="ident">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="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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">get_tx</span>, <span class="ident">txid</span>, <span class="ident">include_raw</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">get_last_index</span>, <span class="ident">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyDatabase</span>, <span class="self">self</span>, <span class="ident">increment_last_index</span>, <span class="ident">keychain</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BatchOperations</span> <span class="kw">for</span> <span class="ident">AnyBatch</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">set_script_pubkey</span>, <span class="ident">script</span>, <span class="ident">keychain</span>, <span class="ident">child</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">set_utxo</span>, <span class="ident">utxo</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">set_raw_tx</span>, <span class="ident">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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">set_tx</span>, <span class="ident">transaction</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">set_last_index</span>, <span class="ident">keychain</span>, <span class="ident">value</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_script_pubkey_from_path</span>, <span class="ident">keychain</span>, <span class="ident">child</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">KeychainKind</span>, <span class="ident">u32</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_path_from_script_pubkey</span>, <span class="ident">script</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_utxo</span>, <span class="ident">outpoint</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_raw_tx</span>, <span class="ident">txid</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_tx</span>, <span class="ident">txid</span>, <span class="ident">include_raw</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">keychain</span>: <span class="ident">KeychainKind</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="macro">impl_inner_method</span><span class="macro">!</span>(<span class="ident">AnyBatch</span>, <span class="self">self</span>, <span class="ident">del_last_index</span>, <span class="ident">keychain</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BatchDatabase</span> <span class="kw">for</span> <span class="ident">AnyDatabase</span> {
+ <span class="kw">type</span> <span class="ident">Batch</span> <span class="op">=</span> <span class="ident">AnyBatch</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="kw">match</span> <span class="self">self</span> {
+ <span class="ident">AnyDatabase</span>::<span class="ident">Memory</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="ident">begin_batch</span>().<span class="ident">into</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">AnyDatabase</span>::<span class="ident">Sled</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">inner</span>.<span class="ident">begin_batch</span>().<span class="ident">into</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="comment">// TODO: refactor once `move_ref_pattern` is stable</span>
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">irrefutable_let_patterns</span>)]</span>
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">AnyDatabase</span>::<span class="ident">Memory</span>(<span class="ident">db</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">AnyBatch</span>::<span class="ident">Memory</span>(<span class="ident">batch</span>) <span class="op">=</span> <span class="ident">batch</span> {
+ <span class="ident">db</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)
+ } <span class="kw">else</span> {
+ <span class="macro">unimplemented</span><span class="macro">!</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">AnyDatabase</span>::<span class="ident">Sled</span>(<span class="ident">db</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw">let</span> <span class="ident">AnyBatch</span>::<span class="ident">Sled</span>(<span class="ident">batch</span>) <span class="op">=</span> <span class="ident">batch</span> {
+ <span class="ident">db</span>.<span class="ident">commit_batch</span>(<span class="ident">batch</span>)
+ } <span class="kw">else</span> {
+ <span class="macro">unimplemented</span><span class="macro">!</span>()
+ }
+ }
+ }
+ }
+}
+
+<span class="doccomment">/// Configuration type for a [`sled::Tree`] database</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="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SledDbConfiguration</span> {
+ <span class="doccomment">/// Main directory of the db</span>
+ <span class="kw">pub</span> <span class="ident">path</span>: <span class="ident">String</span>,
+ <span class="doccomment">/// Name of the database tree, a separated namespace for the data</span>
+ <span class="kw">pub</span> <span class="ident">tree_name</span>: <span class="ident">String</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">impl</span> <span class="ident">ConfigurableDatabase</span> <span class="kw">for</span> <span class="ident">sled</span>::<span class="ident">Tree</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">SledDbConfiguration</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="prelude-val">Ok</span>(<span class="ident">sled</span>::<span class="ident">open</span>(<span class="kw-2">&</span><span class="ident">config</span>.<span class="ident">path</span>)<span class="question-mark">?</span>.<span class="ident">open_tree</span>(<span class="kw-2">&</span><span class="ident">config</span>.<span class="ident">tree_name</span>)<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// Type that can contain any of the database configurations defined by the library</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This allows storing a single configuration that can be loaded into an [`AnyDatabase`]</span>
+<span class="doccomment">/// instance. Wallets that plan to offer users the ability to switch blockchain backend at runtime</span>
+<span class="doccomment">/// will find this particularly useful.</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">serde</span>::<span class="ident">Serialize</span>, <span class="ident">serde</span>::<span class="ident">Deserialize</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">AnyDatabaseConfig</span> {
+ <span class="doccomment">/// Memory database has no config</span>
+ <span class="ident">Memory</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="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">"key-value-db"</span>)))]</span>
+ <span class="doccomment">/// Simple key-value embedded database based on [`sled`]</span>
+ <span class="ident">Sled</span>(<span class="ident">SledDbConfiguration</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">ConfigurableDatabase</span> <span class="kw">for</span> <span class="ident">AnyDatabase</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">AnyDatabaseConfig</span>;
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="prelude-val">Ok</span>(<span class="kw">match</span> <span class="ident">config</span> {
+ <span class="ident">AnyDatabaseConfig</span>::<span class="ident">Memory</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">AnyDatabase</span>::<span class="ident">Memory</span>(<span class="ident">memory</span>::<span class="ident">MemoryDatabase</span>::<span class="ident">from_config</span>(<span class="ident">inner</span>)<span class="question-mark">?</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">AnyDatabaseConfig</span>::<span class="ident">Sled</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">AnyDatabase</span>::<span class="ident">Sled</span>(<span class="ident">sled</span>::<span class="ident">Tree</span>::<span class="ident">from_config</span>(<span class="ident">inner</span>)<span class="question-mark">?</span>),
+ })
+ }
+}
+
+<span class="macro">impl_from</span><span class="macro">!</span>((), <span class="ident">AnyDatabaseConfig</span>, <span class="ident">Memory</span>,);
+<span class="macro">impl_from</span><span class="macro">!</span>(<span class="ident">SledDbConfiguration</span>, <span class="ident">AnyDatabaseConfig</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">"key-value-db"</span>)]</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 of the Rust file `src/database/keyvalue.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>keyvalue.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">KeychainKind</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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">keychain</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">keychain</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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">process_delete</span><span class="macro">!</span>(<span class="macro-nonterminal">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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">KeychainKind</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">keychain</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="kw-2">*</span><span class="ident">outpoint</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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 of the Rust file `src/database/memory.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>memory.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">ConfigurableDatabase</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">KeychainKind</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">KeychainKind</span>),
+ <span class="ident">DescriptorChecksum</span>(<span class="ident">KeychainKind</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">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">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">u8</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">to_owned</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="ident">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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">KeychainKind</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">keychain</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="kw-2">*</span><span class="ident">outpoint</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">KeychainKind</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">keychain</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="kw-2">*</span><span class="ident">outpoint</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</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">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_with</span>(<span class="op">|</span><span class="op">|</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="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="prelude-val">Ok</span>(())
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ConfigurableDatabase</span> <span class="kw">for</span> <span class="ident">MemoryDatabase</span> {
+ <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> ();
+
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">_config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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="prelude-val">Ok</span>(<span class="ident">MemoryDatabase</span>::<span class="ident">default</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</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 of the Rust file `src/database/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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="kw">pub</span> <span class="kw">mod</span> <span class="ident">any</span>;
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">any</span>::{<span class="ident">AnyDatabase</span>, <span class="ident">AnyDatabaseConfig</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 keychain 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">keychain</span>: <span class="ident">KeychainKind</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 keychain.</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">keychain</span>: <span class="ident">KeychainKind</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 keychain 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">keychain</span>: <span class="ident">KeychainKind</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 keychain 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">KeychainKind</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 keychain.</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">keychain</span>: <span class="ident">KeychainKind</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 keychain.</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">KeychainKind</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 child number of a keychain.</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">keychain</span>: <span class="ident">KeychainKind</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 keychain 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">KeychainKind</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 keychain.</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">keychain</span>: <span class="ident">KeychainKind</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 keychain and return 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">keychain</span>: <span class="ident">KeychainKind</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="doccomment">/// Trait for [`Database`] types that can be created given a configuration</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ConfigurableDatabase</span>: <span class="ident">Database</span> <span class="op">+</span> <span class="ident">Sized</span> {
+ <span class="doccomment">/// Type that contains the configuration</span>
+ <span class="kw">type</span> <span class="ident">Config</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span>;
+
+ <span class="doccomment">/// Create a new instance given a configuration</span>
+ <span class="kw">fn</span> <span class="ident">from_config</span>(<span class="ident">config</span>: <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Config</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">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="kw-2">*</span><span class="ident">outpoint</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">keychain</span> <span class="op">=</span> <span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</span> <span class="op">=</span> <span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</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">keychain</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">keychain</span> <span class="op">=</span> <span class="ident">KeychainKind</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">keychain</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">keychain</span> <span class="op">=</span> <span class="ident">KeychainKind</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">keychain</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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 of the Rust file `src/descriptor/checksum.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>checksum.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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>))
+}
+
+<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="kw-2">*</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">get_checksum</span>;
+
+ <span class="comment">// test get_checksum() function; it should return the same value as Bitcoin Core</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_get_checksum</span>() {
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">get_checksum</span>(<span class="ident">desc</span>).<span class="ident">unwrap</span>(), <span class="string">"tqz0nc62"</span>);
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"pkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/44'/1'/0'/0/*)"</span>;
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">get_checksum</span>(<span class="ident">desc</span>).<span class="ident">unwrap</span>(), <span class="string">"lasegmfs"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_get_checksum_invalid_character</span>() {
+ <span class="kw">let</span> <span class="ident">sparkle_heart</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">240</span>, <span class="number">159</span>, <span class="number">146</span>, <span class="number">150</span>];
+ <span class="kw">let</span> <span class="ident">sparkle_heart</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">from_utf8</span>(<span class="kw-2">&</span><span class="ident">sparkle_heart</span>)
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">chars</span>()
+ .<span class="ident">next</span>()
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">invalid_desc</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcL{}fjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>, <span class="ident">sparkle_heart</span>);
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(
+ <span class="ident">get_checksum</span>(<span class="kw-2">&</span><span class="ident">invalid_desc</span>).<span class="ident">err</span>(),
+ <span class="prelude-val">Some</span>(<span class="ident">Error</span>::<span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">invalid_char</span>)) <span class="kw">if</span> <span class="ident">invalid_char</span> <span class="op">=</span><span class="op">=</span> <span class="ident">sparkle_heart</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 of the Rust file `src/descriptor/dsl.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>dsl.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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 DSL</span>
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_top_level_sh</span> {
+ <span class="comment">// disallow `sortedmulti` in `bare()`</span>
+ ( <span class="ident">Bare</span>, <span class="ident">Bare</span>, <span class="ident">sortedmulti</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro">compile_error</span><span class="macro">!</span>(<span class="string">"`bare()` descriptors can't contain any `sortedmulti` operands"</span>);
+ };
+ ( <span class="ident">Bare</span>, <span class="ident">Bare</span>, <span class="ident">sortedmulti_vec</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro">compile_error</span><span class="macro">!</span>(<span class="string">"`bare()` descriptors can't contain any `sortedmulti_vec` operands"</span>);
+ };
+
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">sortedmulti_variant</span>:<span class="ident">ident</span>, <span class="ident">sortedmulti</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_sortedmulti</span><span class="macro">!</span>(<span class="macro-nonterminal">sortedmulti</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">inner</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>((<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Descriptor</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">sortedmulti_variant</span>(<span class="ident">inner</span>), <span class="ident">key_map</span>, <span class="ident">valid_networks</span>)))
+ };
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">sortedmulti_variant</span>:<span class="ident">ident</span>, <span class="ident">sortedmulti_vec</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_sortedmulti</span><span class="macro">!</span>(<span class="macro-nonterminal">sortedmulti_vec</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">inner</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>((<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Descriptor</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">sortedmulti_variant</span>(<span class="ident">inner</span>), <span class="ident">key_map</span>, <span class="ident">valid_networks</span>)))
+ };
+
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">sortedmulti_variant</span>:<span class="ident">ident</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>)
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">minisc</span>, <span class="ident">keymap</span>, <span class="ident">networks</span>)<span class="op">|</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Descriptor</span>::<span class="op"><</span><span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span><span class="op">></span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>(<span class="ident">minisc</span>), <span class="ident">keymap</span>, <span class="ident">networks</span>))
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_top_level_pk</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span>:<span class="ident">ty</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> {{
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused_imports</span>)]</span>
+ <span class="kw">use</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">ToDescriptorKey</span>};
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+
+ <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>.<span class="ident">to_descriptor_key</span>()
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">key</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span><span class="op">></span><span class="op">|</span> <span class="ident">key</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>))
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">pk</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>)<span class="op">|</span> {
+ (
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Descriptor</span>::<span class="op"><</span>
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKey</span>,
+ <span class="op">></span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">descriptor_variant</span>(<span class="ident">pk</span>),
+ <span class="ident">key_map</span>,
+ <span class="ident">valid_networks</span>,
+ )
+ })
+ }};
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_modifier</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="op">-</span><span class="op">></span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">Error</span> { <span class="ident">e</span>.<span class="ident">into</span>() })
+ .<span class="ident">and_then</span>(<span class="op">|</span>(<span class="ident">minisc</span>, <span class="ident">keymap</span>, <span class="ident">networks</span>)<span class="op">|</span> <span class="prelude-val">Ok</span>((<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>(<span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">minisc</span>)))<span class="question-mark">?</span>, <span class="ident">keymap</span>, <span class="ident">networks</span>)))
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_leaf_opcode</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>,
+ )
+ .<span class="ident">map_err</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">Error</span>::<span class="ident">Miniscript</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">minisc</span><span class="op">|</span> {
+ (
+ <span class="ident">minisc</span>,
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">KeyMap</span>::<span class="ident">default</span>(),
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">any_network</span>(),
+ )
+ })
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_leaf_opcode_value</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>),
+ )
+ .<span class="ident">map_err</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">Error</span>::<span class="ident">Miniscript</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">minisc</span><span class="op">|</span> {
+ (
+ <span class="ident">minisc</span>,
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">KeyMap</span>::<span class="ident">default</span>(),
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">any_network</span>(),
+ )
+ })
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_leaf_opcode_value_two</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">one</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">two</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">one</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">two</span>),
+ )
+ .<span class="ident">map_err</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">Error</span>::<span class="ident">Miniscript</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">minisc</span><span class="op">|</span> {
+ (
+ <span class="ident">minisc</span>,
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">KeyMap</span>::<span class="ident">default</span>(),
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">any_network</span>(),
+ )
+ })
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_node_opcode_two</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="kw-2">*</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">a</span><span class="op">|</span> <span class="prelude-val">Ok</span>((<span class="ident">a</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="kw-2">*</span>)<span class="question-mark">?</span>)))
+ .<span class="ident">and_then</span>(<span class="op">|</span>((<span class="ident">a_minisc</span>, <span class="kw-2">mut</span> <span class="ident">a_keymap</span>, <span class="ident">a_networks</span>), (<span class="ident">b_minisc</span>, <span class="ident">b_keymap</span>, <span class="ident">b_networks</span>))<span class="op">|</span> {
+ <span class="comment">// join key_maps</span>
+ <span class="ident">a_keymap</span>.<span class="ident">extend</span>(<span class="ident">b_keymap</span>.<span class="ident">into_iter</span>());
+
+ <span class="prelude-val">Ok</span>((<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>(
+ <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">a_minisc</span>),
+ <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">b_minisc</span>),
+ ))<span class="question-mark">?</span>, <span class="ident">a_keymap</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">merge_networks</span>(<span class="kw-2">&</span><span class="ident">a_networks</span>, <span class="kw-2">&</span><span class="ident">b_networks</span>)))
+ })
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_node_opcode_three</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>:<span class="ident">ident</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">c</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> {
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="kw-2">*</span>)
+ .<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">a</span><span class="op">|</span> <span class="prelude-val">Ok</span>((<span class="ident">a</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="kw-2">*</span>)<span class="question-mark">?</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">c</span> )<span class="kw-2">*</span>)<span class="question-mark">?</span>)))
+ .<span class="ident">and_then</span>(<span class="op">|</span>((<span class="ident">a_minisc</span>, <span class="kw-2">mut</span> <span class="ident">a_keymap</span>, <span class="ident">a_networks</span>), (<span class="ident">b_minisc</span>, <span class="ident">b_keymap</span>, <span class="ident">b_networks</span>), (<span class="ident">c_minisc</span>, <span class="ident">c_keymap</span>, <span class="ident">c_networks</span>))<span class="op">|</span> {
+ <span class="comment">// join key_maps</span>
+ <span class="ident">a_keymap</span>.<span class="ident">extend</span>(<span class="ident">b_keymap</span>.<span class="ident">into_iter</span>());
+ <span class="ident">a_keymap</span>.<span class="ident">extend</span>(<span class="ident">c_keymap</span>.<span class="ident">into_iter</span>());
+
+ <span class="kw">let</span> <span class="ident">networks</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">merge_networks</span>(<span class="kw-2">&</span><span class="ident">a_networks</span>, <span class="kw-2">&</span><span class="ident">b_networks</span>);
+ <span class="kw">let</span> <span class="ident">networks</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">merge_networks</span>(<span class="kw-2">&</span><span class="ident">networks</span>, <span class="kw-2">&</span><span class="ident">c_networks</span>);
+
+ <span class="prelude-val">Ok</span>((<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">miniscript</span>::<span class="ident">decode</span>::<span class="ident">Terminal</span>::<span class="macro-nonterminal">$</span><span class="macro-nonterminal">terminal_variant</span>(
+ <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">a_minisc</span>),
+ <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">b_minisc</span>),
+ <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">c_minisc</span>),
+ ))<span class="question-mark">?</span>, <span class="ident">a_keymap</span>, <span class="ident">networks</span>))
+ })
+ };
+}
+
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">impl_sortedmulti</span> {
+ ( <span class="ident">sortedmulti_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">keys</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">make_sortedmulti_inner</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">keys</span>, <span class="kw-2">&</span><span class="ident">secp</span>)
+ });
+ ( <span class="ident">sortedmulti</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span> $(, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> )<span class="op">+</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">use</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">ToDescriptorKey</span>;
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">keys</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ $(
+ <span class="ident">keys</span>.<span class="ident">push</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>.<span class="ident">to_descriptor_key</span>());
+ )<span class="op">*</span>
+
+ <span class="ident">keys</span>.<span class="ident">into_iter</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">and_then</span>(<span class="op">|</span><span class="ident">keys</span><span class="op">|</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">make_sortedmulti_inner</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="ident">keys</span>, <span class="kw-2">&</span><span class="ident">secp</span>))
+ });
+
+}
+
+<span class="doccomment">/// Macro to write full descriptors with code</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This macro expands to a `Result` of</span>
+<span class="doccomment">/// [`DescriptorTemplateOut`](super::template::DescriptorTemplateOut) and [`Error`](crate::Error)</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Signature plus timelock, equivalent to: `sh(wsh(and_v(v:pk(...), older(...))))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use std::str::FromStr;</span>
+<span class="doccomment">/// let my_key = bitcoin::PublicKey::from_str("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c")?;</span>
+<span class="doccomment">/// let my_timelock = 50;</span>
+<span class="doccomment">/// let (my_descriptor, my_keys_map, networks) = bdk::descriptor!(sh ( wsh ( and_v (+v pk my_key), ( older my_timelock ))))?;</span>
+<span class="doccomment">/// # Ok::<(), Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// -------</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// 2-of-3 that becomes a 1-of-3 after a timelock has expired. Both `descriptor_a` and `descriptor_b` are equivalent: the first</span>
+<span class="doccomment">/// syntax is more suitable for a fixed number of items known at compile time, while the other accepts a</span>
+<span class="doccomment">/// [`Vec`] of items, which makes it more suitable for writing dynamic descriptors.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// They both produce the descriptor: `wsh(thresh(2,pk(...),s:pk(...),sdv:older(...)))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use std::str::FromStr;</span>
+<span class="doccomment">/// let my_key_1 = bitcoin::PublicKey::from_str("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c")?;</span>
+<span class="doccomment">/// let my_key_2 = bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;</span>
+<span class="doccomment">/// let my_timelock = 50;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let (descriptor_a, key_map_a, networks) = bdk::descriptor! {</span>
+<span class="doccomment">/// wsh (</span>
+<span class="doccomment">/// thresh 2, (pk my_key_1), (+s pk my_key_2), (+s+d+v older my_timelock)</span>
+<span class="doccomment">/// )</span>
+<span class="doccomment">/// }?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let b_items = vec![</span>
+<span class="doccomment">/// bdk::fragment!(pk my_key_1)?,</span>
+<span class="doccomment">/// bdk::fragment!(+s pk my_key_2)?,</span>
+<span class="doccomment">/// bdk::fragment!(+s+d+v older my_timelock)?,</span>
+<span class="doccomment">/// ];</span>
+<span class="doccomment">/// let (descriptor_b, mut key_map_b, networks) = bdk::descriptor!( wsh ( thresh_vec 2, b_items ) )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(descriptor_a, descriptor_b);</span>
+<span class="doccomment">/// assert_eq!(key_map_a.len(), key_map_b.len());</span>
+<span class="doccomment">/// # Ok::<(), Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ------</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Simple 2-of-2 multi-signature, equivalent to: `wsh(multi(2, ...))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use std::str::FromStr;</span>
+<span class="doccomment">/// let my_key_1 = bitcoin::PublicKey::from_str(</span>
+<span class="doccomment">/// "02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c",</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">/// let my_key_2 =</span>
+<span class="doccomment">/// bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let (descriptor, key_map, networks) = bdk::descriptor! {</span>
+<span class="doccomment">/// wsh (</span>
+<span class="doccomment">/// multi 2, my_key_1, my_key_2</span>
+<span class="doccomment">/// )</span>
+<span class="doccomment">/// }?;</span>
+<span class="doccomment">/// # Ok::<(), Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ------</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Native-Segwit single-sig, equivalent to: `wpkh(...)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// let my_key =</span>
+<span class="doccomment">/// bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let (descriptor, key_map, networks) = bdk::descriptor!(wpkh(my_key))?;</span>
+<span class="doccomment">/// # Ok::<(), Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">descriptor</span> {
+ ( <span class="ident">bare</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_sh</span><span class="macro">!</span>(<span class="macro-nonterminal">Bare</span>, <span class="ident">Bare</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="ident">sh</span> ( <span class="ident">wsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="macro-nonterminal">shwsh</span> ($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>))
+ });
+ ( <span class="ident">shwsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_sh</span><span class="macro">!</span>(<span class="macro-nonterminal">ShWsh</span>, <span class="ident">ShWshSortedMulti</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="ident">pk</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_pk</span><span class="macro">!</span>(<span class="macro-nonterminal">Pk</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Legacy</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>)
+ });
+ ( <span class="ident">pkh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_pk</span><span class="macro">!</span>(<span class="macro-nonterminal">Pkh</span>,<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Legacy</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>)
+ });
+ ( <span class="ident">wpkh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_pk</span><span class="macro">!</span>(<span class="macro-nonterminal">Wpkh</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Segwitv0</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>)
+ });
+ ( <span class="ident">sh</span> ( <span class="ident">wpkh</span> ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="macro-nonterminal">shwpkh</span> ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span> ))
+ });
+ ( <span class="ident">shwpkh</span> ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_pk</span><span class="macro">!</span>(<span class="macro-nonterminal">ShWpkh</span>, <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">Segwitv0</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>)
+ });
+ ( <span class="ident">sh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_sh</span><span class="macro">!</span>(<span class="macro-nonterminal">Sh</span>, <span class="ident">ShSortedMulti</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="ident">wsh</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_top_level_sh</span><span class="macro">!</span>(<span class="macro-nonterminal">Wsh</span>, <span class="ident">WshSortedMulti</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">minisc</span> )<span class="kw-2">*</span>)
+ });
+}
+
+<span class="doccomment">/// Macro to write descriptor fragments with code</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This macro will be expanded to an object of type `Result<(Miniscript<DescriptorPublicKey, _>, KeyMap, ValidNetworks), Error>`. It allows writing</span>
+<span class="doccomment">/// fragments of larger descriptors that can be pieced together using `fragment!(thresh_vec ...)`.</span>
+<span class="attribute">#[<span class="ident">macro_export</span>]</span>
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">fragment</span> {
+ <span class="comment">// Modifiers</span>
+ ( <span class="op">+</span><span class="ident">a</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">Alt</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">s</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">Swap</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">c</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">Check</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">d</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">DupIf</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">v</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">Verify</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">j</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">NonZero</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">n</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_modifier</span><span class="macro">!</span>(<span class="macro-nonterminal">ZeroNotEqual</span>, $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="kw-2">*</span>)
+ });
+ ( <span class="op">+</span><span class="ident">t</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="macro-nonterminal">and_v</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="op">*</span> ), ( <span class="bool-val">true</span> ) )
+ });
+ ( <span class="op">+</span><span class="ident">l</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="macro-nonterminal">or_i</span> ( <span class="bool-val">false</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="op">*</span> ) )
+ });
+ ( <span class="op">+</span><span class="ident">u</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="macro-nonterminal">or_i</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span> )<span class="op">*</span> ), ( <span class="bool-val">false</span> ) )
+ });
+
+ <span class="comment">// Miniscript</span>
+ ( <span class="bool-val">true</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode</span><span class="macro">!</span>(<span class="macro-nonterminal">True</span>)
+ });
+ ( <span class="bool-val">false</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode</span><span class="macro">!</span>(<span class="macro-nonterminal">False</span>)
+ });
+ ( <span class="ident">pk_k</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">make_pk</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>, <span class="kw-2">&</span><span class="ident">secp</span>)
+ });
+ ( <span class="ident">pk</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="op">+</span><span class="macro-nonterminal">c</span> <span class="ident">pk_k</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>)
+ });
+ ( <span class="ident">pk_h</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key_hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">PkH</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key_hash</span>)
+ });
+ ( <span class="ident">after</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">After</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>)
+ });
+ ( <span class="ident">older</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">Older</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>)
+ });
+ ( <span class="ident">sha256</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">Sha256</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>)
+ });
+ ( <span class="ident">hash256</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">Hash256</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>)
+ });
+ ( <span class="ident">ripemd160</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">Ripemd160</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>)
+ });
+ ( <span class="ident">hash160</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value</span><span class="macro">!</span>(<span class="macro-nonterminal">Hash160</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">hash</span>)
+ });
+ ( <span class="ident">and_v</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">AndV</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">and_b</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">AndB</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">and_or</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">c</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_three</span><span class="macro">!</span>(<span class="macro-nonterminal">AndOr</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">c</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">or_b</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">OrB</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">or_d</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">OrD</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">or_c</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">OrC</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">or_i</span> ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span>:<span class="ident">tt</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span>:<span class="ident">tt</span> )<span class="op">*</span> ) ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_node_opcode_two</span><span class="macro">!</span>(<span class="macro-nonterminal">OrI</span>, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">a</span> )<span class="op">*</span> ), ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">b</span> )<span class="op">*</span> ))
+ });
+ ( <span class="ident">thresh_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">items</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">use</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">KeyMap</span>;
+
+ <span class="kw">let</span> (<span class="ident">items</span>, <span class="ident">key_maps_networks</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="macro-nonterminal">$</span><span class="macro-nonterminal">items</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">a</span>, <span class="ident">b</span>, <span class="ident">c</span>)<span class="op">|</span> (<span class="ident">a</span>, (<span class="ident">b</span>, <span class="ident">c</span>))).<span class="ident">unzip</span>();
+ <span class="kw">let</span> <span class="ident">items</span> <span class="op">=</span> <span class="ident">items</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>::<span class="ident">new</span>).<span class="ident">collect</span>();
+
+ <span class="kw">let</span> (<span class="ident">key_maps</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="ident">key_maps_networks</span>.<span class="ident">into_iter</span>().<span class="ident">fold</span>((<span class="ident">KeyMap</span>::<span class="ident">default</span>(), <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">any_network</span>()), <span class="op">|</span>(<span class="kw-2">mut</span> <span class="ident">keys_acc</span>, <span class="ident">net_acc</span>), (<span class="ident">key</span>, <span class="ident">net</span>)<span class="op">|</span> {
+ <span class="ident">keys_acc</span>.<span class="ident">extend</span>(<span class="ident">key</span>.<span class="ident">into_iter</span>());
+ <span class="kw">let</span> <span class="ident">net_acc</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">merge_networks</span>(<span class="kw-2">&</span><span class="ident">net_acc</span>, <span class="kw-2">&</span><span class="ident">net</span>);
+
+ (<span class="ident">keys_acc</span>, <span class="ident">net_acc</span>)
+ });
+
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">impl_leaf_opcode_value_two</span><span class="macro">!</span>(<span class="macro-nonterminal">Thresh</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="ident">items</span>)
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">minisc</span>, <span class="kw">_</span>, <span class="kw">_</span>)<span class="op">|</span> (<span class="ident">minisc</span>, <span class="ident">key_maps</span>, <span class="ident">valid_networks</span>))
+ });
+ ( <span class="ident">thresh</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span> $(, ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">item</span>:<span class="ident">tt</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">items</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ $(
+ <span class="ident">items</span>.<span class="ident">push</span>(<span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>($( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">item</span> )<span class="kw-2">*</span>));
+ )<span class="op">*</span>
+
+ <span class="ident">items</span>.<span class="ident">into_iter</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">and_then</span>(<span class="op">|</span><span class="ident">items</span><span class="op">|</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro">fragment</span><span class="macro">!</span>(<span class="macro-nonterminal">thresh_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="ident">items</span>))
+ });
+ ( <span class="ident">multi_vec</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">keys</span>:<span class="ident">expr</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">make_multi</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">keys</span>)
+ });
+ ( <span class="ident">multi</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>:<span class="ident">expr</span> $(, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>:<span class="ident">expr</span> )<span class="op">+</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="kw">use</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">ToDescriptorKey</span>;
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">keys</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
+ $(
+ <span class="ident">keys</span>.<span class="ident">push</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">key</span>.<span class="ident">to_descriptor_key</span>());
+ )<span class="op">*</span>
+
+ <span class="ident">keys</span>.<span class="ident">into_iter</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">and_then</span>(<span class="op">|</span><span class="ident">keys</span><span class="op">|</span> <span class="macro-nonterminal">$</span><span class="kw">crate</span>::<span class="macro-nonterminal">keys</span>::<span class="ident">make_multi</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">thresh</span>, <span class="ident">keys</span>, <span class="kw-2">&</span><span class="ident">secp</span>))
+ });
+
+ <span class="comment">// `sortedmulti()` is handled separately</span>
+ ( <span class="ident">sortedmulti</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro">compile_error</span><span class="macro">!</span>(<span class="string">"`sortedmulti` can only be used as the root operand of a descriptor"</span>);
+ });
+ ( <span class="ident">sortedmulti_vec</span> $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">></span> ({
+ <span class="macro">compile_error</span><span class="macro">!</span>(<span class="string">"`sortedmulti_vec` can only be used as the root operand of a descriptor"</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">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">secp256k1</span>::<span class="ident">Secp256k1</span>;
+ <span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorPublicKeyCtx</span>, <span class="ident">KeyMap</span>};
+ <span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Descriptor</span>, <span class="ident">Legacy</span>, <span class="ident">Segwitv0</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="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorMeta</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">KeyError</span>, <span class="ident">ToDescriptorKey</span>, <span class="ident">ValidNetworks</span>};
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">network</span>::<span class="ident">constants</span>::<span class="ident">Network</span>::{<span class="ident">Bitcoin</span>, <span class="ident">Regtest</span>, <span class="ident">Testnet</span>};
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</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="comment">// test the descriptor!() macro</span>
+
+ <span class="comment">// verify descriptor generates expected script(s) (if bare or pk) or address(es)</span>
+ <span class="kw">fn</span> <span class="ident">check</span>(
+ <span class="ident">desc</span>: <span class="prelude-ty">Result</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">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span>,
+ <span class="ident">is_witness</span>: <span class="ident">bool</span>,
+ <span class="ident">is_fixed</span>: <span class="ident">bool</span>,
+ <span class="ident">expected</span>: <span class="kw-2">&</span>[<span class="kw-2">&</span><span class="ident">str</span>],
+ ) {
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">DescriptorPublicKeyCtx</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">secp</span>, <span class="ident">ChildNumber</span>::<span class="ident">Normal</span> { <span class="ident">index</span>: <span class="number">0</span> });
+
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">_key_map</span>, <span class="ident">_networks</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_witness</span>(), <span class="ident">is_witness</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_fixed</span>(), <span class="ident">is_fixed</span>);
+ <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">expected</span>.<span class="ident">len</span>() {
+ <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>;
+ <span class="kw">let</span> <span class="ident">child_desc</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">desc</span>.<span class="ident">is_fixed</span>() {
+ <span class="ident">desc</span>.<span class="ident">clone</span>()
+ } <span class="kw">else</span> {
+ <span class="ident">desc</span>.<span class="ident">derive</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="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">child_desc</span>.<span class="ident">address</span>(<span class="ident">Regtest</span>, <span class="ident">deriv_ctx</span>);
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">address</span>) <span class="op">=</span> <span class="ident">address</span> {
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">address</span>.<span class="ident">to_string</span>(), <span class="kw-2">*</span><span class="ident">expected</span>.<span class="ident">get</span>(<span class="ident">i</span>).<span class="ident">unwrap</span>());
+ } <span class="kw">else</span> {
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="ident">child_desc</span>.<span class="ident">script_pubkey</span>(<span class="ident">deriv_ctx</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">script</span>.<span class="ident">to_hex</span>().<span class="ident">as_str</span>(), <span class="kw-2">*</span><span class="ident">expected</span>.<span class="ident">get</span>(<span class="ident">i</span>).<span class="ident">unwrap</span>());
+ }
+ }
+ }
+
+ <span class="comment">// - at least one of each "type" of operator; ie. one modifier, one leaf_opcode, one leaf_opcode_value, etc.</span>
+ <span class="comment">// - mixing up key types that implement ToDescriptorKey in multi() or thresh()</span>
+
+ <span class="comment">// expected script for pk and bare manually created</span>
+ <span class="comment">// expected addresses created with `bitcoin-cli getdescriptorinfo` (for hash) and `bitcoin-cli deriveaddresses`</span>
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_fixed_legacy_descriptors</span>() {
+ <span class="kw">let</span> <span class="ident">pubkey1</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">pubkey2</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"032e58afe51f9ed8ad3cc7897f634d881fdbe49a81564629ded8156bebd2ffd1af"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">bare</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">pubkey1</span>,<span class="ident">pubkey2</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"512103a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd21032e58afe51f9ed8ad3cc7897f634d881fdbe49a81564629ded8156bebd2ffd1af52ae"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pk</span>(<span class="ident">pubkey1</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2103a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bdac"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="ident">pubkey1</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"muZpTpBYhxmRFuCjLc7C6BBDF32C8XVJUi"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">pubkey1</span>,<span class="ident">pubkey2</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2MymURoV1bzuMnWMGiXzyomDkeuxXY7Suey"</span>],
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_fixed_segwitv0_descriptors</span>() {
+ <span class="kw">let</span> <span class="ident">pubkey1</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">pubkey2</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"032e58afe51f9ed8ad3cc7897f634d881fdbe49a81564629ded8156bebd2ffd1af"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">pubkey1</span>)),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"bcrt1qngw83fg8dz0k749cg7k3emc7v98wy0c7azaa6h"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wpkh</span>(<span class="ident">pubkey1</span>))),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2N5LiC3CqzxDamRTPG1kiNv1FpNJQ7x28sb"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wsh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">pubkey1</span>,<span class="ident">pubkey2</span>)),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"bcrt1qgw8jvv2hsrvjfa6q66rk6har7d32lrqm5unnf5cl63q9phxfvgps5fyfqe"</span>],
+ );
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wsh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">pubkey1</span>,<span class="ident">pubkey2</span>))),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2NCidRJysy7apkmE6JF5mLLaJFkrN3Ub9iy"</span>],
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip32_legacy_descriptors</span>() {
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pk</span>(<span class="ident">desc_key</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2102363ad03c10024e1b597a5b01b9982807fb638e00b06f3b2d4a89707de3b93c37ac"</span>,
+ <span class="string">"2102063a21fd780df370ed2fc8c4b86aa5ea642630609c203009df631feb7b480dd2ac"</span>,
+ <span class="string">"2102ba2685ad1fa5891cb100f1656b2ce3801822ccb9bac0336734a6f8c1b93ebbc0ac"</span>,
+ ],
+ );
+
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="ident">desc_key</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"muvBdsVpJxpFuTHMKA47htJPdCvdt4F9DP"</span>,
+ <span class="string">"mxQSHK7DL2t1DN3xFxov1janCoXSSkrSPj"</span>,
+ <span class="string">"mfz43r15GiWo4nizmyzMNubsnkDpByFFAn"</span>,
+ ],
+ );
+
+ <span class="kw">let</span> <span class="ident">path2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/2147483647'/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key1</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key2</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path2</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">desc_key1</span>,<span class="ident">desc_key2</span>)),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2MtMDXsfwefZkEEhVViEPidvcKRUtJamJJ8"</span>,
+ <span class="string">"2MwAUZ1NYyWjhVvGTethFL6n7nZhS8WE6At"</span>,
+ <span class="string">"2MuT6Bj66HLwZd7s4SoD8XbK4GwriKEA6Gr"</span>,
+ ],
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip32_segwitv0_descriptors</span>() {
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">desc_key</span>)),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qnhm8w9fhc8cxzgqsmqdf9fyjccyvc0gltnymu0"</span>,
+ <span class="string">"bcrt1qhylfd55rn75w9fj06zspctad5w4hz33rf0ttad"</span>,
+ <span class="string">"bcrt1qq5sq3a6k9av9d8cne0k9wcldy4nqey5yt6889r"</span>,
+ ],
+ );
+
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wpkh</span>(<span class="ident">desc_key</span>))),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2MxvjQCaLqZ5QxZ7XotZDQ63hZw3NPss763"</span>,
+ <span class="string">"2NDUoevN4QMzhvHDMGhKuiT2fN9HXbFRMwn"</span>,
+ <span class="string">"2NF4BEAY2jF1Fu8vqfN3NVKoFtom77pUxrx"</span>,
+ ],
+ );
+
+ <span class="kw">let</span> <span class="ident">path2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/2147483647'/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key1</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key2</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path2</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wsh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">desc_key1</span>,<span class="ident">desc_key2</span>)),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qfxv8mxmlv5sz8q2mnuyaqdfe9jr4vvmx0csjhn092p6f4qfygfkq2hng49"</span>,
+ <span class="string">"bcrt1qerj85g243e6jlcdxpmn9spk0gefcwvu7nw7ee059d5ydzpdhkm2qwfkf5k"</span>,
+ <span class="string">"bcrt1qxkl2qss3k58q9ktc8e89pwr4gnptfpw4hju4xstxcjc0hkcae3jstluty7"</span>,
+ ],
+ );
+
+ <span class="kw">let</span> <span class="ident">desc_key1</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key2</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path2</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wsh</span>(<span class="ident">multi</span> <span class="number">1</span>,<span class="ident">desc_key1</span>,<span class="ident">desc_key2</span>))),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2NFCtXvx9q4ci2kvKub17iSTgvRXGctCGhz"</span>,
+ <span class="string">"2NB2PrFPv5NxWCpygas8tPrGJG2ZFgeuwJw"</span>,
+ <span class="string">"2N79ZAGo5cMi5Jt7Wo9L5YmF5GkEw7sjWdC"</span>,
+ ],
+ );
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_dsl_sortedmulti</span>() {
+ <span class="kw">let</span> <span class="ident">key_1</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path_1</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key_2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPegBHHnq7YEgM815dG24M2Jk5RVqipgDxF1HJ1tsnT815X5Fd5FRfMVUs8NZs9XCb6y9an8hRPThnhfwfXJ36intaekySHGF"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path_2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/1"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">desc_key1</span> <span class="op">=</span> (<span class="ident">key_1</span>, <span class="ident">path_1</span>);
+ <span class="kw">let</span> <span class="ident">desc_key2</span> <span class="op">=</span> (<span class="ident">key_2</span>, <span class="ident">path_2</span>);
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">sortedmulti</span> <span class="number">1</span>, <span class="ident">desc_key1</span>.<span class="ident">clone</span>(), <span class="ident">desc_key2</span>.<span class="ident">clone</span>())),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2MsxzPEJDBzpGffJXPaDpfXZAUNnZhaMh2N"</span>,
+ <span class="string">"2My3x3DLPK3UbGWGpxrXr1RnbD8MNC4FpgS"</span>,
+ <span class="string">"2NByEuiQT7YLqHCTNxL5KwYjvtuCYcXNBSC"</span>,
+ <span class="string">"2N1TGbP81kj2VUKTSWgrwxoMfuWjvfUdyu7"</span>,
+ <span class="string">"2N3Bomq2fpAcLRNfZnD3bCWK9quan28CxCR"</span>,
+ <span class="string">"2N9nrZaEzEFDqEAU9RPvDnXGT6AVwBDKAQb"</span>,
+ ],
+ );
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wsh</span>(<span class="ident">sortedmulti</span> <span class="number">1</span>, <span class="ident">desc_key1</span>.<span class="ident">clone</span>(), <span class="ident">desc_key2</span>.<span class="ident">clone</span>()))),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2NCogc5YyM4N6ruv1hUa7WLMW1BPeCK7N9B"</span>,
+ <span class="string">"2N6mkSAKi1V2oaBXby7XHdvBMKEDRQcFpNe"</span>,
+ <span class="string">"2NFmTSttm9v6bXeoWaBvpMcgfPQcZhNn3Eh"</span>,
+ <span class="string">"2Mvib87RBPUHXNEpX5S5Kv1qqrhBfgBGsJM"</span>,
+ <span class="string">"2MtMv5mcK2EjcLsH8Txpx2JxLLzHr4ttczL"</span>,
+ <span class="string">"2MsWCB56rb4T6yPv8QudZGHERTwNgesE4f6"</span>,
+ ],
+ );
+
+ <span class="ident">check</span>(
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wsh</span>(<span class="ident">sortedmulti_vec</span> <span class="number">1</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">desc_key1</span>, <span class="ident">desc_key2</span>])),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qcvq0lg8q7a47ytrd7zk5y7uls7mulrenjgvflwylpppgwf8029es4vhpnj"</span>,
+ <span class="string">"bcrt1q80yn8sdt6l7pjvkz25lglyaqctlmsq9ugk80rmxt8yu0npdsj97sc7l4de"</span>,
+ <span class="string">"bcrt1qrvf6024v9s50qhffe3t2fr2q9ckdhx2g6jz32chm2pp24ymgtr5qfrdmct"</span>,
+ <span class="string">"bcrt1q6srfmra0ynypym35c7jvsxt2u4yrugeajq95kg2ps7lk6h2gaunsq9lzxn"</span>,
+ <span class="string">"bcrt1qhl8rrzzcdpu7tcup3lcg7tge52sqvwy5fcv4k78v6kxtwmqf3v6qpvyjza"</span>,
+ <span class="string">"bcrt1ql2elz9mhm9ll27ddpewhxs732xyl2fk2kpkqz9gdyh33wgcun4vstrd49k"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// - verify the valid_networks returned is correctly computed based on the keys present in the descriptor</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_valid_networks</span>() {
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">_desc</span>, <span class="ident">_key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="ident">desc_key</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">valid_networks</span>, [<span class="ident">Testnet</span>, <span class="ident">Regtest</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>());
+
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/10/20/30/40"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">_desc</span>, <span class="ident">_key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">desc_key</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">valid_networks</span>, [<span class="ident">Bitcoin</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>());
+ }
+
+ <span class="comment">// - verify the key_maps are correctly merged together</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_key_maps_merged</span>() {
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="ident">xprv1</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path1</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key1</span> <span class="op">=</span> (<span class="ident">xprv1</span>, <span class="ident">path1</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">xprv2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPegBHHnq7YEgM815dG24M2Jk5RVqipgDxF1HJ1tsnT815X5Fd5FRfMVUs8NZs9XCb6y9an8hRPThnhfwfXJ36intaekySHGF"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path2</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/2147483647'/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key2</span> <span class="op">=</span> (<span class="ident">xprv2</span>, <span class="ident">path2</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">xprv3</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPdZXrcHNLf5JAJWFAoJ2TrstMRdSKtEggz6PddbuSkvHKM9oKJyFgZV1B7rw8oChspxyYbtmEXYyg1AjfWbL3ho3XHDpHRZf"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path3</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/10/20/30/40"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key3</span> <span class="op">=</span> (<span class="ident">xprv3</span>, <span class="ident">path3</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">_desc</span>, <span class="ident">key_map</span>, <span class="ident">_valid_networks</span>) <span class="op">=</span>
+ <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wsh</span>(<span class="ident">multi</span> <span class="number">2</span>,<span class="ident">desc_key1</span>,<span class="ident">desc_key2</span>,<span class="ident">desc_key3</span>))).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">key_map</span>.<span class="ident">len</span>(), <span class="number">3</span>);
+
+ <span class="kw">let</span> <span class="ident">desc_key1</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ (<span class="ident">xprv1</span>, <span class="ident">path1</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key2</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ (<span class="ident">xprv2</span>, <span class="ident">path2</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key3</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ (<span class="ident">xprv3</span>, <span class="ident">path3</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">key1</span>, <span class="ident">_key_map</span>, <span class="ident">_valid_networks</span>) <span class="op">=</span> <span class="ident">desc_key1</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">key2</span>, <span class="ident">_key_map</span>, <span class="ident">_valid_networks</span>) <span class="op">=</span> <span class="ident">desc_key2</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">key3</span>, <span class="ident">_key_map</span>, <span class="ident">_valid_networks</span>) <span class="op">=</span> <span class="ident">desc_key3</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">key_map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key1</span>).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy/0/*"</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">key_map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key2</span>).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"tprv8ZgxMBicQKsPegBHHnq7YEgM815dG24M2Jk5RVqipgDxF1HJ1tsnT815X5Fd5FRfMVUs8NZs9XCb6y9an8hRPThnhfwfXJ36intaekySHGF/2147483647'/0/*"</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">key_map</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key3</span>).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(), <span class="string">"tprv8ZgxMBicQKsPdZXrcHNLf5JAJWFAoJ2TrstMRdSKtEggz6PddbuSkvHKM9oKJyFgZV1B7rw8oChspxyYbtmEXYyg1AjfWbL3ho3XHDpHRZf/10/20/30/40/*"</span>);
+ }
+
+ <span class="comment">// - verify the ScriptContext is correctly validated (i.e. passing a type that only impl ToDescriptorKey<Segwitv0> to a pkh() descriptor should throw a compilation error</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_script_context_validation</span>() {
+ <span class="comment">// this compiles</span>
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">desc_key</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span> <span class="op">=</span> (<span class="ident">xprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">_key_map</span>, <span class="ident">_valid_networks</span>) <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="ident">desc_key</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">to_string</span>(), <span class="string">"pkh(tpubD6NzVbkrYhZ4WR7a4vY1VT3khMJMeAxVsfq9TBJyJWrNk247zCJtV7AWf6UJP7rAVsn8NNKdJi3gFyKPTmWZS9iukb91xbn2HbFSMQm2igY/0/*)"</span>);
+
+ <span class="comment">// as expected this does not compile due to invalid context</span>
+ <span class="comment">//let desc_key:DescriptorKey<Segwitv0> = (xprv, path.clone()).to_descriptor_key().unwrap();</span>
+ <span class="comment">//let (desc, _key_map, _valid_networks) = descriptor!(pkh(desc_key)).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 of the Rust file `src/descriptor/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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="comment">//InternalError,</span>
+ <span class="comment">//InvalidPrefix(Vec<u8>),</span>
+ <span class="comment">//HardenedDerivationOnXpub,</span>
+ <span class="comment">//MalformedInput,</span>
+ <span class="doccomment">/// Invalid HD Key path, such as having a wildcard but a length != 1</span>
+ <span class="ident">InvalidHDKeyPath</span>,
+
+ <span class="comment">//KeyParsingError(String),</span>
+ <span class="doccomment">/// Error thrown while working with [`keys`](crate::keys)</span>
+ <span class="ident">Key</span>(<span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>),
+ <span class="doccomment">/// Error while extracting and manipulating policies</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="comment">//InputIndexDoesntExist,</span>
+ <span class="comment">//MissingPublicKey,</span>
+ <span class="comment">//MissingDetails,</span>
+ <span class="doccomment">/// Invalid character found in the descriptor checksum</span>
+ <span class="ident">InvalidDescriptorCharacter</span>(<span class="ident">char</span>),
+
+ <span class="comment">//CantDeriveWithMiniscript,</span>
+ <span class="doccomment">/// BIP32 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="doccomment">/// Error during base58 decoding</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="doccomment">/// Key-related 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="doccomment">/// Miniscript error</span>
+ <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Hex decoding 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">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</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">key_error</span>: <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Error</span> {
+ <span class="kw">match</span> <span class="ident">key_error</span> {
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>::<span class="ident">Miniscript</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">Miniscript</span>(<span class="ident">inner</span>),
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>::<span class="ident">BIP32</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">BIP32</span>(<span class="ident">inner</span>),
+ <span class="ident">e</span> <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">Key</span>(<span class="ident">e</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 of the Rust file `src/descriptor/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">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">ExtendedPubKey</span>, <span class="ident">Fingerprint</span>, <span class="ident">KeySource</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">Network</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">KeyMap</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">mod</span> <span class="ident">dsl</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">mod</span> <span class="ident">template</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="self">self</span>::<span class="ident">template</span>::<span class="ident">DescriptorTemplateOut</span>;
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">KeyError</span>, <span class="ident">ToDescriptorKey</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="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">utils</span>::{<span class="ident">descriptor_to_pk_ctx</span>, <span class="ident">SecpCtx</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">KeySource</span><span class="op">></span>;
+
+<span class="doccomment">/// Trait for types which can be converted into an [`ExtendedDescriptor`] and a [`KeyMap`] usable by a wallet in a specific [`Network`]</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ToWalletDescriptor</span> {
+ <span class="doccomment">/// Convert to wallet descriptor</span>
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span>;
+}
+
+<span class="kw">impl</span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> <span class="kw-2">&</span><span class="ident">str</span> {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">descriptor</span> <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">contains</span>(<span class="string">'#'</span>) {
+ <span class="kw">let</span> <span class="ident">parts</span>: <span class="ident">Vec</span><span class="op"><</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">splitn</span>(<span class="number">2</span>, <span class="string">'#'</span>).<span class="ident">collect</span>();
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">get_checksum</span>(<span class="ident">parts</span>[<span class="number">0</span>])
+ .<span class="ident">ok</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">computed</span><span class="op">|</span> <span class="ident">computed</span> <span class="op">=</span><span class="op">=</span> <span class="ident">parts</span>[<span class="number">1</span>])
+ .<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
+ {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidChecksum</span>);
+ }
+
+ <span class="ident">parts</span>[<span class="number">0</span>]
+ } <span class="kw">else</span> {
+ <span class="self">self</span>
+ };
+
+ <span class="ident">ExtendedDescriptor</span>::<span class="ident">parse_descriptor</span>(<span class="ident">descriptor</span>)<span class="question-mark">?</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> <span class="kw-2">&</span><span class="ident">String</span> {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="ident">as_str</span>().<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> <span class="ident">ExtendedDescriptor</span> {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ (<span class="self">self</span>, <span class="ident">KeyMap</span>::<span class="ident">default</span>()).<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> (<span class="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>) {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">DescriptorKey</span>;
+
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+
+ <span class="kw">let</span> <span class="ident">check_key</span> <span class="op">=</span> <span class="op">|</span><span class="ident">pk</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> {
+ <span class="kw">let</span> (<span class="ident">pk</span>, <span class="kw">_</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">is_witness</span>() {
+ <span class="kw">let</span> <span class="ident">desciptor_key</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">pk</span>.<span class="ident">clone</span>().<span class="ident">to_descriptor_key</span>()<span class="question-mark">?</span>;
+ <span class="ident">desciptor_key</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>)<span class="question-mark">?</span>
+ } <span class="kw">else</span> {
+ <span class="kw">let</span> <span class="ident">desciptor_key</span>: <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">miniscript</span>::<span class="ident">Legacy</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">pk</span>.<span class="ident">clone</span>().<span class="ident">to_descriptor_key</span>()<span class="question-mark">?</span>;
+ <span class="ident">desciptor_key</span>.<span class="ident">extract</span>(<span class="kw-2">&</span><span class="ident">secp</span>)<span class="question-mark">?</span>
+ };
+
+ <span class="kw">if</span> <span class="ident">networks</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">network</span>) {
+ <span class="prelude-val">Ok</span>(<span class="ident">pk</span>)
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidNetwork</span>)
+ }
+ };
+
+ <span class="comment">// check the network for the keys</span>
+ <span class="kw">let</span> <span class="ident">translated</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">translate_pk</span>(<span class="ident">check_key</span>, <span class="ident">check_key</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">translated</span>, <span class="self">self</span>.<span class="number">1</span>))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> <span class="ident">DescriptorTemplateOut</span> {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">valid_networks</span> <span class="op">=</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="number">2</span>;
+
+ <span class="kw">let</span> <span class="ident">fix_key</span> <span class="op">=</span> <span class="op">|</span><span class="ident">pk</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span><span class="op">|</span> {
+ <span class="kw">if</span> <span class="ident">valid_networks</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">network</span>) {
+ <span class="comment">// workaround for xpubs generated by other key types, like bip39: since when the</span>
+ <span class="comment">// conversion is made one network has to be chosen, what we generally choose</span>
+ <span class="comment">// "mainnet", but then override the set of valid networks to specify that all of</span>
+ <span class="comment">// them are valid. here we reset the network to make sure the wallet struct gets a</span>
+ <span class="comment">// descriptor with the right network everywhere.</span>
+ <span class="kw">let</span> <span class="ident">pk</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">pk</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="kw-2">ref</span> <span class="ident">xpub</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">xpub</span> <span class="op">=</span> <span class="ident">xpub</span>.<span class="ident">clone</span>();
+ <span class="ident">xpub</span>.<span class="ident">xkey</span>.<span class="ident">network</span> <span class="op">=</span> <span class="ident">network</span>;
+
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">xpub</span>)
+ }
+ <span class="ident">other</span> <span class="op">=</span><span class="op">></span> <span class="ident">other</span>.<span class="ident">clone</span>(),
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">pk</span>)
+ } <span class="kw">else</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidNetwork</span>)
+ }
+ };
+
+ <span class="comment">// fixup the network for keys that need it</span>
+ <span class="kw">let</span> <span class="ident">translated</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">translate_pk</span>(<span class="ident">fix_key</span>, <span class="ident">fix_key</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">translated</span>, <span class="self">self</span>.<span class="number">1</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="doccomment">/// Extract the spending [`policy`]</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="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="self">self</span>.<span class="ident">origin</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="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">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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Fingerprint</span> {
+ <span class="kw">match</span> <span class="self">self</span>.<span class="ident">origin</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="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="ident">secp</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">get_extended_keys</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">DescriptorXKey</span><span class="op"><</span><span class="ident">ExtendedPubKey</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">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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">DescriptorScripts</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">psbt_redeem_script</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="ident">secp</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">deriv_ctx</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">deriv_ctx</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">deriv_ctx</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="ident">deriv_ctx</span>)),
+ <span class="ident">Descriptor</span>::<span class="ident">ShSortedMulti</span>(<span class="kw-2">ref</span> <span class="ident">keys</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">keys</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="ident">secp</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">deriv_ctx</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">deriv_ctx</span>)),
+ <span class="ident">Descriptor</span>::<span class="ident">WshSortedMulti</span>(<span class="kw-2">ref</span> <span class="ident">keys</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWshSortedMulti</span>(<span class="kw-2">ref</span> <span class="ident">keys</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Some</span>(<span class="ident">keys</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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="ident">Descriptor</span>::<span class="ident">ShSortedMulti</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="ident">Descriptor</span>::<span class="ident">ShWshSortedMulti</span>(<span class="kw">_</span>)
+ <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">WshSortedMulti</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">translate_key</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="ident">index</span>: <span class="ident">u32</span>,
+ <span class="ident">paths</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">HDKeyPaths</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">DummyKey</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">SinglePub</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">paths</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">secp</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="kw-2">mut</span> <span class="ident">answer_pk</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer_pkh</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(
+ <span class="op">|</span><span class="ident">pk</span><span class="op">|</span> <span class="ident">translate_key</span>(<span class="ident">pk</span>, <span class="ident">index</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pk</span>),
+ <span class="op">|</span><span class="ident">pkh</span><span class="op">|</span> <span class="ident">translate_key</span>(<span class="ident">pkh</span>, <span class="ident">index</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pkh</span>),
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">answer_pk</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pkh</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">answer_pk</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">get_extended_keys</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">DescriptorXKey</span><span class="op"><</span><span class="ident">ExtendedPubKey</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">get_key</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="ident">keys</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">DescriptorXKey</span><span class="op"><</span><span class="ident">ExtendedPubKey</span><span class="op">></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">DummyKey</span>, <span class="ident">Error</span><span class="op">></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="ident">keys</span>.<span class="ident">push</span>(<span class="ident">xpub</span>.<span class="ident">clone</span>())
+ }
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DummyKey</span>::<span class="ident">default</span>())
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">answer_pk</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">answer_pkh</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(
+ <span class="op">|</span><span class="ident">pk</span><span class="op">|</span> <span class="ident">get_key</span>(<span class="ident">pk</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pk</span>),
+ <span class="op">|</span><span class="ident">pkh</span><span class="op">|</span> <span class="ident">get_key</span>(<span class="ident">pkh</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pkh</span>),
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">answer_pk</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">answer_pkh</span>);
+
+ <span class="prelude-val">Ok</span>(<span class="ident">answer_pk</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">check_key</span>(<span class="ident">key</span>: <span class="kw-2">&</span><span class="ident">DescriptorPublicKey</span>, <span class="ident">flag</span>: <span class="kw-2">&</span><span class="kw-2">mut</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">DummyKey</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">SinglePub</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="kw-2">*</span><span class="ident">flag</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="kw-2">mut</span> <span class="ident">found_wildcard_pk</span> <span class="op">=</span> <span class="bool-val">false</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">found_wildcard_pkh</span> <span class="op">=</span> <span class="bool-val">false</span>;
+
+ <span class="self">self</span>.<span class="ident">translate_pk</span>(
+ <span class="op">|</span><span class="ident">pk</span><span class="op">|</span> <span class="ident">check_key</span>(<span class="ident">pk</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">found_wildcard_pk</span>),
+ <span class="op">|</span><span class="ident">pkh</span><span class="op">|</span> <span class="ident">check_key</span>(<span class="ident">pkh</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">found_wildcard_pkh</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="op">!</span><span class="ident">found_wildcard_pk</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">found_wildcard_pkh</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">try_key</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="ident">index</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">Fingerprint</span>, <span class="ident">DerivationPath</span><span class="op">></span>,
+ <span class="ident">found_path</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">ChildNumber</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">DummyKey</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="ident">found_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`. We expect this to be a derivation</span>
+ <span class="comment">// path of length 1 if the key `is_wildcard` and an empty path otherwise.</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">secp</span>);
+ <span class="kw">let</span> <span class="ident">derivation_path</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">ChildNumber</span><span class="op">></span><span class="op">></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="kw-2">*</span><span class="ident">fingerprint</span>, <span class="ident">path</span>.<span class="ident">clone</span>()), <span class="ident">secp</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">secp</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">into_iter</span>().<span class="ident">count</span>())
+ .<span class="ident">cloned</span>()
+ .<span class="ident">collect</span>()
+ });
+
+ <span class="kw">match</span> <span class="ident">derivation_path</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">is_wildcard</span> <span class="op">&&</span> <span class="ident">path</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">1</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw-2">*</span><span class="ident">found_path</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>[<span class="number">0</span>])
+ }
+ <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="kw">if</span> <span class="op">!</span><span class="ident">xpub</span>.<span class="ident">is_wildcard</span> <span class="op">&&</span> <span class="ident">path</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="kw-2">*</span><span class="ident">found_path</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">ChildNumber</span>::<span class="ident">Normal</span> { <span class="ident">index</span>: <span class="number">0</span> })
+ }
+ <span class="prelude-val">Some</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">Error</span>::<span class="ident">InvalidHDKeyPath</span>),
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></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">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">found_path_pk</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">found_path_pkh</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+
+ <span class="kw">if</span> <span class="self">self</span>
+ .<span class="ident">translate_pk</span>(
+ <span class="op">|</span><span class="ident">pk</span><span class="op">|</span> <span class="ident">try_key</span>(<span class="ident">pk</span>, <span class="kw-2">&</span><span class="ident">index</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">found_path_pk</span>),
+ <span class="op">|</span><span class="ident">pkh</span><span class="op">|</span> <span class="ident">try_key</span>(<span class="ident">pkh</span>, <span class="kw-2">&</span><span class="ident">index</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">found_path_pkh</span>),
+ )
+ .<span class="ident">is_err</span>()
+ {
+ <span class="kw">return</span> <span class="prelude-val">None</span>;
+ }
+
+ <span class="comment">// if we have found a path for both `found_path_pk` and `found_path_pkh` but they are</span>
+ <span class="comment">// different we consider this an error and return None. we only return a path either if</span>
+ <span class="comment">// they are equal or if only one of them is Some(_)</span>
+ <span class="kw">let</span> <span class="ident">merged_path</span> <span class="op">=</span> <span class="kw">match</span> (<span class="ident">found_path_pk</span>, <span class="ident">found_path_pkh</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="kw">if</span> <span class="ident">a</span> <span class="op">!</span><span class="op">=</span> <span class="ident">b</span> <span class="op">=</span><span class="op">></span> <span class="kw">return</span> <span class="prelude-val">None</span>,
+ (<span class="ident">a</span>, <span class="ident">b</span>) <span class="op">=</span><span class="op">></span> <span class="ident">a</span>.<span class="ident">or</span>(<span class="ident">b</span>),
+ };
+
+ <span class="ident">merged_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="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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</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">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="ident">secp</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="op">&&</span> <span class="self">self</span>.<span class="ident">script_pubkey</span>(<span class="ident">deriv_ctx</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="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</span>.<span class="ident">is_some</span>()
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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">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="op">&&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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="op">&&</span> <span class="kw-2">&</span><span class="ident">ms</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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="ident">Descriptor</span>::<span class="ident">ShSortedMulti</span>(<span class="ident">keys</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="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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">WshSortedMulti</span>(<span class="ident">keys</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">ShWshSortedMulti</span>(<span class="ident">keys</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="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>.<span class="ident">encode</span>(<span class="ident">deriv_ctx</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">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">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="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</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="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</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="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</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="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</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_to_wallet_descriptor_fixup_networks</span>() {
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">any_network</span>, <span class="ident">ToDescriptorKey</span>};
+
+ <span class="kw">let</span> <span class="ident">xpub</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/0"</span>).<span class="ident">unwrap</span>();
+
+ <span class="comment">// here `to_descriptor_key` will set the valid networks for the key to only mainnet, since</span>
+ <span class="comment">// we are using an "xpub"</span>
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> (<span class="ident">xpub</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="comment">// override it with any. this happens in some key conversions, like bip39</span>
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">override_valid_networks</span>(<span class="ident">any_network</span>());
+
+ <span class="comment">// make a descriptor out of it</span>
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">key</span>)).<span class="ident">unwrap</span>();
+ <span class="comment">// this should conver the key that supports "any_network" to the right network (testnet)</span>
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet_desc</span>.<span class="ident">to_string</span>(), <span class="string">"wpkh(tpubDEnoLuPdBep9bzw5LoGYpsxUQYheRQ9gcgrJhJEcdKFB9cWQRyYmkCyRoTqeD4tJYiVVgt6A3rN6rWn9RYhR9sBsGxji29LYWHuKKbdb1ev/0/*)"</span>);
+ }
+
+ <span class="comment">// test ToWalletDescriptor trait from &str with and without checksum appended</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_descriptor_from_str_with_checksum</span>() {
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)#tqz0nc62"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)#67ju93jw"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)#67ju93jw"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">err</span>(), <span class="prelude-val">Some</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidChecksum</span>)));
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)#67ju93jw"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">err</span>(), <span class="prelude-val">Some</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidChecksum</span>)));
+ }
+
+ <span class="comment">// test ToWalletDescriptor trait from &str with keys from right and wrong network</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_descriptor_from_str_with_keys_network</span>() {
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Regtest</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Regtest</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"sh(wpkh(02864bb4ad00cefa806098a69e192bbda937494e69eb452b87bb3f20f6283baedb))"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"sh(wpkh(02864bb4ad00cefa806098a69e192bbda937494e69eb452b87bb3f20f6283baedb))"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Bitcoin</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_ok</span>());
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Bitcoin</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">err</span>(), <span class="prelude-val">Some</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidNetwork</span>)));
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)"</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Bitcoin</span>);
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">err</span>(), <span class="prelude-val">Some</span>(<span class="ident">KeyError</span>::<span class="ident">InvalidNetwork</span>)));
+ }
+
+ <span class="comment">// test ToWalletDescriptor trait from the output of the descriptor!() macro</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_descriptor_from_str_from_output_of_macro</span>() {
+ <span class="kw">let</span> <span class="ident">tpub</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/1/2"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> (<span class="ident">tpub</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ <span class="comment">// make a descriptor out of it</span>
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">key</span>)).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">wallet_desc_str</span> <span class="op">=</span> <span class="ident">wallet_desc</span>.<span class="ident">to_string</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet_desc_str</span>, <span class="string">"wpkh(tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/2/*)"</span>);
+
+ <span class="kw">let</span> (<span class="ident">wallet_desc2</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">wallet_desc_str</span>
+ .<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>)
+ .<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wallet_desc</span>, <span class="ident">wallet_desc2</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 of the Rust file `src/descriptor/policy.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>policy.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! This is an **EXPERIMENTAL** feature, API and other major changes are expected.</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">//! # use bdk::bitcoin::secp256k1::Secp256k1;</span>
+<span class="doccomment">//! let secp = Secp256k1::new();</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_descriptor(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, &secp)?;</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="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="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">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="ident">SortedMultiVec</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="ident">ToPublicKey</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">crate</span>::<span class="ident">wallet</span>::<span class="ident">utils</span>::{<span class="self">self</span>, <span class="ident">descriptor_to_pk_ctx</span>, <span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">SinglePub</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="ident">pubkey</span>.<span class="ident">key</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">secp</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 needs 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="doccomment">/// Signature for a raw public key</span>
+ <span class="ident">Signature</span>(<span class="ident">PKOrF</span>),
+ <span class="doccomment">/// Signature for an extended key fingerprint</span>
+ <span class="ident">SignatureKey</span>(<span class="ident">PKOrF</span>),
+ <span class="doccomment">/// SHA256 preimage hash</span>
+ <span class="ident">SHA256Preimage</span> {
+ <span class="doccomment">/// The digest value</span>
+ <span class="ident">hash</span>: <span class="ident">sha256</span>::<span class="ident">Hash</span>,
+ },
+ <span class="doccomment">/// Double SHA256 preimage hash</span>
+ <span class="ident">HASH256Preimage</span> {
+ <span class="doccomment">/// The digest value</span>
+ <span class="ident">hash</span>: <span class="ident">sha256d</span>::<span class="ident">Hash</span>,
+ },
+ <span class="doccomment">/// RIPEMD160 preimage hash</span>
+ <span class="ident">RIPEMD160Preimage</span> {
+ <span class="doccomment">/// The digest value</span>
+ <span class="ident">hash</span>: <span class="ident">ripemd160</span>::<span class="ident">Hash</span>,
+ },
+ <span class="doccomment">/// SHA256 then RIPEMD160 preimage hash</span>
+ <span class="ident">HASH160Preimage</span> {
+ <span class="doccomment">/// The digest value</span>
+ <span class="ident">hash</span>: <span class="ident">hash160</span>::<span class="ident">Hash</span>,
+ },
+ <span class="doccomment">/// Absolute timeclock timestamp</span>
+ <span class="ident">AbsoluteTimelock</span> {
+ <span class="doccomment">/// The timestamp value</span>
+ <span class="ident">value</span>: <span class="ident">u32</span>,
+ },
+ <span class="doccomment">/// Relative timelock locktime</span>
+ <span class="ident">RelativeTimelock</span> {
+ <span class="doccomment">/// The locktime value</span>
+ <span class="ident">value</span>: <span class="ident">u32</span>,
+ },
+ <span class="doccomment">/// Multi-signature public keys with threshold count</span>
+ <span class="ident">Multisig</span> {
+ <span class="doccomment">/// The raw public key or extended key fingerprint</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="doccomment">/// The required threshold count</span>
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ },
+
+ <span class="comment">// Complex item</span>
+ <span class="doccomment">/// Threshold items with threshold count</span>
+ <span class="ident">Thresh</span> {
+ <span class="doccomment">/// The policy items</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="doccomment">/// The required threshold count</span>
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ },
+}
+
+<span class="kw">impl</span> <span class="ident">SatisfiableItem</span> {
+ <span class="doccomment">/// Returns whether the [`SatisfiableItem`] is a leaf item</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="op">!</span><span class="macro">matches</span><span class="macro">!</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="doccomment">/// Returns a unique id for the [`SatisfiableItem`]</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">usize</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="doccomment">/// Type for a map of sets of [`Condition`] items keyed by each set's index</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="doccomment">/// Type for a map of folded sets of [`Condition`] items keyed by a vector of the combined set's indexes</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">"Option::is_none"</span>)]</span>
+ <span class="doccomment">/// Whether the items are sorted in lexicographic order (used by `sortedmulti`)</span>
+ <span class="ident">sorted</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bool</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">skip_serializing_if</span> <span class="op">=</span> <span class="string">"Option::is_none"</span>)]</span>
+ <span class="doccomment">/// Whether the items are sorted in lexicographic order (used by `sortedmulti`)</span>
+ <span class="ident">sorted</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bool</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="doccomment">/// Returns whether the [`Satisfaction`] is a leaf item</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="ident">sorted</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">map</span>(<span class="op">|</span><span class="ident">set</span><span class="op">|</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_default</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 compatible, 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="ident">sorted</span>: <span class="kw-2">*</span><span class="ident">sorted</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="doccomment">/// Optional CheckSequenceVerify 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="doccomment">/// Optional timelock 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">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_nlocktime</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">if</span> (<span class="ident">a</span> <span class="op"><</span> <span class="ident">utils</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">utils</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_nsequence</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">let</span> <span class="ident">mask</span> <span class="op">=</span> <span class="ident">utils</span>::<span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span> <span class="op">|</span> <span class="ident">utils</span>::<span class="ident">SEQUENCE_LOCKTIME_MASK</span>;
+
+ <span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">a</span> <span class="op">&</span> <span class="ident">mask</span>;
+ <span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">b</span> <span class="op">&</span> <span class="ident">mask</span>;
+
+ <span class="kw">if</span> (<span class="ident">a</span> <span class="op"><</span> <span class="ident">utils</span>::<span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span>) <span class="op">!</span><span class="op">=</span> (<span class="ident">b</span> <span class="op"><</span> <span class="ident">utils</span>::<span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</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">pub</span>(<span class="kw">crate</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_nsequence</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_nlocktime</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="doccomment">/// Returns `true` if there are no extra conditions to verify</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="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="doccomment">/// Not enough items are selected to satisfy a [`SatisfiableItem::Thresh`]</span>
+ <span class="ident">NotEnoughItemsSelected</span>(<span class="ident">String</span>),
+ <span class="doccomment">/// Too many items are selected to satisfy a [`SatisfiableItem::Thresh`]</span>
+ <span class="ident">TooManyItemsSelected</span>(<span class="ident">String</span>),
+ <span class="doccomment">/// Index out of range for an item to satisfy a [`SatisfiableItem::Thresh`]</span>
+ <span class="ident">IndexOutOfRange</span>(<span class="ident">usize</span>),
+ <span class="doccomment">/// Can not add to an item that is [`Satisfaction::None`] or [`Satisfaction::Complete`]</span>
+ <span class="ident">AddOnLeaf</span>,
+ <span class="doccomment">/// Can not add to an item that is [`Satisfaction::PartialComplete`]</span>
+ <span class="ident">AddOnPartialComplete</span>,
+ <span class="doccomment">/// Can not merge CSV or timelock values unless both are less than or both are equal or greater than 500_000_000</span>
+ <span class="ident">MixedTimelockUnits</span>,
+ <span class="doccomment">/// Incompatible conditions (not currently used)</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="ident">sorted</span>: <span class="prelude-val">None</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">DescriptorPublicKey</span>],
+ <span class="ident">signers</span>: <span class="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">threshold</span>: <span class="ident">usize</span>,
+ <span class="ident">sorted</span>: <span class="ident">bool</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">secp</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="ident">sorted</span>: <span class="prelude-val">Some</span>(<span class="ident">sorted</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="ident">signers</span>.<span class="ident">find</span>(<span class="ident">signer_id</span>(<span class="ident">key</span>, <span class="ident">secp</span>)).<span class="ident">is_some</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">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">match</span> <span class="ident">selected</span>.<span class="ident">len</span>().<span class="ident">cmp</span>(<span class="ident">threshold</span>) {
+ <span class="ident">Ordering</span>::<span class="ident">Less</span> <span class="op">=</span><span class="op">></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="ident">Ordering</span>::<span class="ident">Greater</span> <span class="op">=</span><span class="op">></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="ident">Ordering</span>::<span class="ident">Equal</span> <span class="op">=</span><span class="op">></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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>) <span class="op">-</span><span class="op">></span> <span class="ident">SignerId</span> {
+ <span class="kw">match</span> <span class="ident">key</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">SinglePub</span>(<span class="ident">pubkey</span>) <span class="op">=</span><span class="op">></span> <span class="ident">pubkey</span>.<span class="ident">key</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">secp</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="kw-2">&</span><span class="ident">SignersContainer</span>, <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">secp</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">secp</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</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="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>,
+) <span class="op">-</span><span class="op">></span> <span class="ident">Policy</span> {
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="ident">secp</span>);
+ <span class="kw">let</span> <span class="ident">key_hash</span> <span class="op">=</span> <span class="ident">key</span>.<span class="ident">to_public_key</span>(<span class="ident">deriv_ctx</span>).<span class="ident">to_pubkeyhash</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="ident">key_hash</span>)).<span class="ident">into</span>();
+
+ <span class="kw">if</span> <span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">SignerId</span>::<span class="ident">PkHash</span>(<span class="ident">key_hash</span>)).<span class="ident">is_some</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="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</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">signers</span>, <span class="kw-2">*</span><span class="ident">k</span>, <span class="bool-val">false</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</span>)<span class="question-mark">?</span>,
+ <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</span>)<span class="question-mark">?</span>,
+ <span class="ident">y</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</span>)<span class="question-mark">?</span>,
+ <span class="ident">b</span>.<span class="ident">extract_policy</span>(<span class="ident">signers</span>, <span class="ident">secp</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">signers</span>, <span class="ident">secp</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="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">fn</span> <span class="ident">make_sortedmulti</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">keys</span>: <span class="kw-2">&</span><span class="ident">SortedMultiVec</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span>, <span class="ident">Ctx</span><span class="op">></span>,
+ <span class="ident">signers</span>: <span class="kw-2">&</span><span class="ident">SignersContainer</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">Policy</span>::<span class="ident">make_multisig</span>(
+ <span class="ident">keys</span>.<span class="ident">pks</span>.<span class="ident">as_ref</span>(),
+ <span class="ident">signers</span>,
+ <span class="ident">keys</span>.<span class="ident">k</span>,
+ <span class="bool-val">true</span>,
+ <span class="ident">secp</span>,
+ )<span class="question-mark">?</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">secp</span>))),
+ <span class="ident">Descriptor</span>::<span class="ident">Bare</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="ident">secp</span>)<span class="question-mark">?</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="ident">secp</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="ident">secp</span>)<span class="question-mark">?</span>)
+ }
+
+ <span class="comment">// `sortedmulti()` is handled separately</span>
+ <span class="ident">Descriptor</span>::<span class="ident">ShSortedMulti</span>(<span class="ident">keys</span>) <span class="op">=</span><span class="op">></span> <span class="ident">make_sortedmulti</span>(<span class="kw-2">&</span><span class="ident">keys</span>, <span class="ident">signers</span>, <span class="ident">secp</span>),
+ <span class="ident">Descriptor</span>::<span class="ident">ShWshSortedMulti</span>(<span class="ident">keys</span>) <span class="op">|</span> <span class="ident">Descriptor</span>::<span class="ident">WshSortedMulti</span>(<span class="ident">keys</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">make_sortedmulti</span>(<span class="kw-2">&</span><span class="ident">keys</span>, <span class="ident">signers</span>, <span class="ident">secp</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">descriptor</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::{<span class="ident">ExtractPolicy</span>, <span class="ident">ToWalletDescriptor</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">descriptor</span>::<span class="ident">policy</span>::<span class="ident">SatisfiableItem</span>::{<span class="ident">Multisig</span>, <span class="ident">Signature</span>, <span class="ident">Thresh</span>};
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">ToDescriptorKey</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="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::{<span class="ident">All</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="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">Network</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">std</span>::<span class="ident">sync</span>::<span class="ident">Arc</span>;
+
+ <span class="kw">const</span> <span class="ident">TPRV0_STR</span>:<span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"tprv8ZgxMBicQKsPdZXrcHNLf5JAJWFAoJ2TrstMRdSKtEggz6PddbuSkvHKM9oKJyFgZV1B7rw8oChspxyYbtmEXYyg1AjfWbL3ho3XHDpHRZf"</span>;
+ <span class="kw">const</span> <span class="ident">TPRV1_STR</span>:<span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N"</span>;
+
+ <span class="kw">const</span> <span class="ident">PATH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"m/44'/1'/0'/0"</span>;
+
+ <span class="kw">fn</span> <span class="ident">setup_keys</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">tprv</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ ) <span class="op">-</span><span class="op">></span> (<span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Fingerprint</span>) {
+ <span class="kw">let</span> <span class="ident">secp</span>: <span class="ident">Secp256k1</span><span class="op"><</span><span class="ident">All</span><span class="op">></span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="ident">PATH</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="ident">tprv</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tpub</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_private</span>(<span class="kw-2">&</span><span class="ident">secp</span>, <span class="kw-2">&</span><span class="ident">tprv</span>);
+ <span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">tprv</span>.<span class="ident">fingerprint</span>(<span class="kw-2">&</span><span class="ident">secp</span>);
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span> (<span class="ident">tprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> (<span class="ident">tpub</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ (<span class="ident">prvkey</span>, <span class="ident">pubkey</span>, <span class="ident">fingerprint</span>)
+ }
+
+ <span class="comment">// test ExtractPolicy trait for simple descriptors; wpkh(), sh(multi())</span>
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_wpkh</span>() {
+ <span class="kw">let</span> (<span class="ident">prvkey</span>, <span class="ident">pubkey</span>, <span class="ident">fingerprint</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">pubkey</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">wallet_desc</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Signature</span>(<span class="ident">pk_or_f</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">pk_or_f</span>.<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>));
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">prvkey</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">wallet_desc</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Signature</span>(<span class="ident">pk_or_f</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">pk_or_f</span>.<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {<span class="ident">condition</span>} <span class="kw">if</span> <span class="ident">condition</span>.<span class="ident">csv</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">None</span> <span class="op">&&</span> <span class="ident">condition</span>.<span class="ident">timelock</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">None</span>)
+ );
+ }
+
+ <span class="comment">// 2 pub keys descriptor, required 2 prv keys</span>
+ <span class="comment">// #[test]</span>
+ <span class="comment">// fn test_extract_policy_for_sh_multi_partial_0of2() {</span>
+ <span class="comment">// let (_prvkey0, pubkey0, fingerprint0) = setup_keys(TPRV0_STR);</span>
+ <span class="comment">// let (_prvkey1, pubkey1, fingerprint1) = setup_keys(TPRV1_STR);</span>
+ <span class="comment">// let desc = descriptor!(sh(multi 2, pubkey0, pubkey1)).unwrap();</span>
+ <span class="comment">// let (wallet_desc, keymap) = desc.to_wallet_descriptor(Network::Testnet).unwrap();</span>
+ <span class="comment">// let signers_container = Arc::new(SignersContainer::from(keymap));</span>
+ <span class="comment">// let policy = wallet_desc</span>
+ <span class="comment">// .extract_policy(signers_container)</span>
+ <span class="comment">// .unwrap()</span>
+ <span class="comment">// .unwrap();</span>
+ <span class="comment">//</span>
+ <span class="comment">// assert!(</span>
+ <span class="comment">// matches!(&policy.item, Multisig { keys, threshold } if threshold == &2</span>
+ <span class="comment">// && &keys[0].fingerprint.unwrap() == &fingerprint0</span>
+ <span class="comment">// && &keys[1].fingerprint.unwrap() == &fingerprint1)</span>
+ <span class="comment">// );</span>
+ <span class="comment">//</span>
+ <span class="comment">// // TODO should this be "Satisfaction::None" since we have no prv keys?</span>
+ <span class="comment">// // TODO should items and conditions not be empty?</span>
+ <span class="comment">// assert!(</span>
+ <span class="comment">// matches!(&policy.contribution, Satisfaction::Partial { n, m, items, conditions} if n == &2</span>
+ <span class="comment">// && m == &2</span>
+ <span class="comment">// && items.is_empty()</span>
+ <span class="comment">// && conditions.is_empty()</span>
+ <span class="comment">// )</span>
+ <span class="comment">// );</span>
+ <span class="comment">// }</span>
+
+ <span class="comment">// 1 prv and 1 pub key descriptor, required 2 prv keys</span>
+ <span class="comment">// #[test]</span>
+ <span class="comment">// fn test_extract_policy_for_sh_multi_partial_1of2() {</span>
+ <span class="comment">// let (prvkey0, _pubkey0, fingerprint0) = setup_keys(TPRV0_STR);</span>
+ <span class="comment">// let (_prvkey1, pubkey1, fingerprint1) = setup_keys(TPRV1_STR);</span>
+ <span class="comment">// let desc = descriptor!(sh(multi 2, prvkey0, pubkey1)).unwrap();</span>
+ <span class="comment">// let (wallet_desc, keymap) = desc.to_wallet_descriptor(Network::Testnet).unwrap();</span>
+ <span class="comment">// let signers_container = Arc::new(SignersContainer::from(keymap));</span>
+ <span class="comment">// let policy = wallet_desc</span>
+ <span class="comment">// .extract_policy(signers_container)</span>
+ <span class="comment">// .unwrap()</span>
+ <span class="comment">// .unwrap();</span>
+ <span class="comment">//</span>
+ <span class="comment">// assert!(</span>
+ <span class="comment">// matches!(&policy.item, Multisig { keys, threshold } if threshold == &2</span>
+ <span class="comment">// && &keys[0].fingerprint.unwrap() == &fingerprint0</span>
+ <span class="comment">// && &keys[1].fingerprint.unwrap() == &fingerprint1)</span>
+ <span class="comment">// );</span>
+ <span class="comment">//</span>
+ <span class="comment">// // TODO should this be "Satisfaction::Partial" since we have only one of two prv keys?</span>
+ <span class="comment">// assert!(</span>
+ <span class="comment">// matches!(&policy.contribution, Satisfaction::PartialComplete { n, m, items, conditions} if n == &2</span>
+ <span class="comment">// && m == &2</span>
+ <span class="comment">// && items.len() == 2</span>
+ <span class="comment">// && conditions.contains_key(&vec![0,1])</span>
+ <span class="comment">// )</span>
+ <span class="comment">// );</span>
+ <span class="comment">// }</span>
+
+ <span class="comment">// 1 prv and 1 pub key descriptor, required 1 prv keys</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">ignore</span>]</span> <span class="comment">// see https://github.com/bitcoindevkit/bdk/issues/225</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_sh_multi_complete_1of2</span>() {
+ <span class="kw">let</span> (<span class="ident">_prvkey0</span>, <span class="ident">pubkey0</span>, <span class="ident">fingerprint0</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> (<span class="ident">prvkey1</span>, <span class="ident">_pubkey1</span>, <span class="ident">fingerprint1</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV1_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">1</span>, <span class="ident">pubkey0</span>, <span class="ident">prvkey1</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">wallet_desc</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Multisig</span> { <span class="ident">keys</span>, <span class="ident">threshold</span> } <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">1</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">0</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint0</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">1</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint1</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { <span class="ident">n</span>, <span class="ident">m</span>, <span class="ident">items</span>, <span class="ident">conditions</span>, .. } <span class="kw">if</span> <span class="ident">n</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">m</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">1</span>
+ <span class="op">&&</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>])
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>])
+ )
+ );
+ }
+
+ <span class="comment">// 2 prv keys descriptor, required 2 prv keys</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_sh_multi_complete_2of2</span>() {
+ <span class="kw">let</span> (<span class="ident">prvkey0</span>, <span class="ident">_pubkey0</span>, <span class="ident">fingerprint0</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> (<span class="ident">prvkey1</span>, <span class="ident">_pubkey1</span>, <span class="ident">fingerprint1</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV1_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">2</span>, <span class="ident">prvkey0</span>, <span class="ident">prvkey1</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">wallet_desc</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Multisig</span> { <span class="ident">keys</span>, <span class="ident">threshold</span> } <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">0</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint0</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">1</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint1</span>)
+ );
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { <span class="ident">n</span>, <span class="ident">m</span>, <span class="ident">items</span>, <span class="ident">conditions</span>, .. } <span class="kw">if</span> <span class="ident">n</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">m</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>,<span class="number">1</span>])
+ )
+ );
+ }
+
+ <span class="comment">// test ExtractPolicy trait with extended and single keys</span>
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_single_wpkh</span>() {
+ <span class="kw">let</span> (<span class="ident">prvkey</span>, <span class="ident">pubkey</span>, <span class="ident">fingerprint</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">pubkey</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">single_key</span> <span class="op">=</span> <span class="ident">wallet_desc</span>.<span class="ident">derive</span>(<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>).<span class="ident">unwrap</span>());
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">single_key</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Signature</span>(<span class="ident">pk_or_f</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">pk_or_f</span>.<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="prelude-val">None</span>));
+
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">prvkey</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">single_key</span> <span class="op">=</span> <span class="ident">wallet_desc</span>.<span class="ident">derive</span>(<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>).<span class="ident">unwrap</span>());
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">single_key</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Signature</span>(<span class="ident">pk_or_f</span>) <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">pk_or_f</span>.<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">Complete</span> {<span class="ident">condition</span>} <span class="kw">if</span> <span class="ident">condition</span>.<span class="ident">csv</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">None</span> <span class="op">&&</span> <span class="ident">condition</span>.<span class="ident">timelock</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">None</span>)
+ );
+ }
+
+ <span class="comment">// single key, 1 prv and 1 pub key descriptor, required 1 prv keys</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">ignore</span>]</span> <span class="comment">// see https://github.com/bitcoindevkit/bdk/issues/225</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_single_wsh_multi_complete_1of2</span>() {
+ <span class="kw">let</span> (<span class="ident">_prvkey0</span>, <span class="ident">pubkey0</span>, <span class="ident">fingerprint0</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> (<span class="ident">prvkey1</span>, <span class="ident">_pubkey1</span>, <span class="ident">fingerprint1</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV1_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">1</span>, <span class="ident">pubkey0</span>, <span class="ident">prvkey1</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">single_key</span> <span class="op">=</span> <span class="ident">wallet_desc</span>.<span class="ident">derive</span>(<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>).<span class="ident">unwrap</span>());
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">single_key</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</span>, <span class="ident">Multisig</span> { <span class="ident">keys</span>, <span class="ident">threshold</span> } <span class="kw">if</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">1</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">0</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint0</span>
+ <span class="op">&&</span> <span class="kw-2">&</span><span class="ident">keys</span>[<span class="number">1</span>].<span class="ident">fingerprint</span>.<span class="ident">unwrap</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">fingerprint1</span>)
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { <span class="ident">n</span>, <span class="ident">m</span>, <span class="ident">items</span>, <span class="ident">conditions</span>, .. } <span class="kw">if</span> <span class="ident">n</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">m</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">1</span>
+ <span class="op">&&</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>])
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>])
+ )
+ );
+ }
+
+ <span class="comment">// test ExtractPolicy trait with descriptors containing timelocks in a thresh()</span>
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="attribute">#[<span class="ident">ignore</span>]</span> <span class="comment">// see https://github.com/bitcoindevkit/bdk/issues/225</span>
+ <span class="kw">fn</span> <span class="ident">test_extract_policy_for_wsh_multi_timelock</span>() {
+ <span class="kw">let</span> (<span class="ident">prvkey0</span>, <span class="ident">_pubkey0</span>, <span class="ident">_fingerprint0</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> (<span class="ident">_prvkey1</span>, <span class="ident">pubkey1</span>, <span class="ident">_fingerprint1</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV1_STR</span>);
+ <span class="kw">let</span> <span class="ident">sequence</span> <span class="op">=</span> <span class="number">50</span>;
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wsh</span> (
+ <span class="ident">thresh</span> <span class="number">2</span>, (<span class="ident">pk</span> <span class="ident">prvkey0</span>), (<span class="op">+</span><span class="ident">s</span> <span class="ident">pk</span> <span class="ident">pubkey1</span>), (<span class="op">+</span><span class="ident">s</span><span class="op">+</span><span class="ident">d</span><span class="op">+</span><span class="ident">v</span> <span class="ident">older</span> <span class="ident">sequence</span>)
+ ))
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> (<span class="ident">wallet_desc</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">signers_container</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">policy</span> <span class="op">=</span> <span class="ident">wallet_desc</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="ident">signers_container</span>, <span class="kw-2">&</span><span class="ident">Secp256k1</span>::<span class="ident">new</span>())
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">item</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="number">3</span> <span class="op">&&</span> <span class="ident">threshold</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>)
+ );
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="ident">policy</span>.<span class="ident">contribution</span>, <span class="ident">Satisfaction</span>::<span class="ident">PartialComplete</span> { <span class="ident">n</span>, <span class="ident">m</span>, <span class="ident">items</span>, <span class="ident">conditions</span>, .. } <span class="kw">if</span> <span class="ident">n</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">3</span>
+ <span class="op">&&</span> <span class="ident">m</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">&</span><span class="number">2</span>
+ <span class="op">&&</span> <span class="ident">items</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">3</span>
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>,<span class="number">1</span>]).<span class="ident">unwrap</span>().<span class="ident">iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">csv</span>.<span class="ident">is_none</span>()
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>,<span class="number">2</span>]).<span class="ident">unwrap</span>().<span class="ident">iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">csv</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sequence</span>)
+ <span class="op">&&</span> <span class="ident">conditions</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>,<span class="number">2</span>]).<span class="ident">unwrap</span>().<span class="ident">iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">csv</span> <span class="op">=</span><span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sequence</span>)
+ )
+ );
+ }
+
+ <span class="comment">// - mixed timelocks should fail</span>
+
+ <span class="comment">// #[test]</span>
+ <span class="comment">// fn test_extract_policy_for_wsh_mixed_timelocks() {</span>
+ <span class="comment">// let (prvkey0, _pubkey0, _fingerprint0) = setup_keys(TPRV0_STR);</span>
+ <span class="comment">// let locktime_threshold = 500000000; // if less than this means block number, else block time in seconds</span>
+ <span class="comment">// let locktime_blocks = 100;</span>
+ <span class="comment">// let locktime_seconds = locktime_blocks + locktime_threshold;</span>
+ <span class="comment">// let desc = descriptor!(sh (and_v (+v pk prvkey0), (and_v (+v after locktime_seconds), (after locktime_blocks)))).unwrap();</span>
+ <span class="comment">// let (wallet_desc, keymap) = desc.to_wallet_descriptor(Network::Testnet).unwrap();</span>
+ <span class="comment">// let signers_container = Arc::new(SignersContainer::from(keymap));</span>
+ <span class="comment">// let policy = wallet_desc</span>
+ <span class="comment">// .extract_policy(signers_container)</span>
+ <span class="comment">// .unwrap()</span>
+ <span class="comment">// .unwrap();</span>
+ <span class="comment">//</span>
+ <span class="comment">// println!("desc policy = {:?}", policy); // TODO remove</span>
+ <span class="comment">//</span>
+ <span class="comment">// // TODO how should this fail with mixed timelocks?</span>
+ <span class="comment">// }</span>
+
+ <span class="comment">// - multiple timelocks of the same type should be correctly merged together</span>
+
+ <span class="comment">// #[test]</span>
+ <span class="comment">// fn test_extract_policy_for_multiple_same_timelocks() {</span>
+ <span class="comment">// let (prvkey0, _pubkey0, _fingerprint0) = setup_keys(TPRV0_STR);</span>
+ <span class="comment">// let locktime_blocks0 = 100;</span>
+ <span class="comment">// let locktime_blocks1 = 200;</span>
+ <span class="comment">// let desc = descriptor!(sh (and_v (+v pk prvkey0), (and_v (+v after locktime_blocks0), (after locktime_blocks1)))).unwrap();</span>
+ <span class="comment">// let (wallet_desc, keymap) = desc.to_wallet_descriptor(Network::Testnet).unwrap();</span>
+ <span class="comment">// let signers_container = Arc::new(SignersContainer::from(keymap));</span>
+ <span class="comment">// let policy = wallet_desc</span>
+ <span class="comment">// .extract_policy(signers_container)</span>
+ <span class="comment">// .unwrap()</span>
+ <span class="comment">// .unwrap();</span>
+ <span class="comment">//</span>
+ <span class="comment">// println!("desc policy = {:?}", policy); // TODO remove</span>
+ <span class="comment">//</span>
+ <span class="comment">// // TODO how should this merge timelocks?</span>
+ <span class="comment">//</span>
+ <span class="comment">// let (prvkey1, _pubkey1, _fingerprint1) = setup_keys(TPRV0_STR);</span>
+ <span class="comment">// let locktime_seconds0 = 500000100;</span>
+ <span class="comment">// let locktime_seconds1 = 500000200;</span>
+ <span class="comment">// let desc = descriptor!(sh (and_v (+v pk prvkey1), (and_v (+v after locktime_seconds0), (after locktime_seconds1)))).unwrap();</span>
+ <span class="comment">// let (wallet_desc, keymap) = desc.to_wallet_descriptor(Network::Testnet).unwrap();</span>
+ <span class="comment">// let signers_container = Arc::new(SignersContainer::from(keymap));</span>
+ <span class="comment">// let policy = wallet_desc</span>
+ <span class="comment">// .extract_policy(signers_container)</span>
+ <span class="comment">// .unwrap()</span>
+ <span class="comment">// .unwrap();</span>
+ <span class="comment">//</span>
+ <span class="comment">// println!("desc policy = {:?}", policy); // TODO remove</span>
+ <span class="comment">//</span>
+ <span class="comment">// // TODO how should this merge timelocks?</span>
+ <span class="comment">// }</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 of the Rust file `src/descriptor/template.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>template.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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 templates</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! This module contains the definition of various common script templates that are ready to be</span>
+<span class="doccomment">//! used. See the documentation of each template for an example.</span>
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Legacy</span>, <span class="ident">Segwitv0</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>, <span class="ident">ToWalletDescriptor</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">DerivableKey</span>, <span class="ident">KeyError</span>, <span class="ident">ToDescriptorKey</span>, <span class="ident">ValidNetworks</span>};
+<span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">descriptor</span>, <span class="ident">KeychainKind</span>};
+
+<span class="doccomment">/// Type alias for the return type of [`DescriptorTemplate`], [`descriptor!`](crate::descriptor!) and others</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">DescriptorTemplateOut</span> <span class="op">=</span> (<span class="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>, <span class="ident">ValidNetworks</span>);
+
+<span class="doccomment">/// Trait for descriptor templates that can be built into a full descriptor</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Since [`ToWalletDescriptor`] is implemented for any [`DescriptorTemplate`], they can also be</span>
+<span class="doccomment">/// passed directly to the [`Wallet`](crate::Wallet) constructor.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// use bdk::keys::{KeyError, ToDescriptorKey};</span>
+<span class="doccomment">/// use bdk::miniscript::Legacy;</span>
+<span class="doccomment">/// use bdk::template::{DescriptorTemplate, DescriptorTemplateOut};</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// struct MyP2PKH<K: ToDescriptorKey<Legacy>>(K);</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// impl<K: ToDescriptorKey<Legacy>> DescriptorTemplate for MyP2PKH<K> {</span>
+<span class="doccomment">/// fn build(self) -> Result<DescriptorTemplateOut, KeyError> {</span>
+<span class="doccomment">/// Ok(bdk::descriptor!(pkh(self.0))?)</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">DescriptorTemplate</span> {
+ <span class="doccomment">/// Build the complete descriptor</span>
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Turns a [`DescriptorTemplate`] into a valid wallet descriptor by calling its</span>
+<span class="doccomment">/// [`build`](DescriptorTemplate::build) method</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">T</span>: <span class="ident">DescriptorTemplate</span><span class="op">></span> <span class="ident">ToWalletDescriptor</span> <span class="kw">for</span> <span class="ident">T</span> {
+ <span class="kw">fn</span> <span class="ident">to_wallet_descriptor</span>(
+ <span class="self">self</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="ident">ExtendedDescriptor</span>, <span class="ident">KeyMap</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">build</span>()<span class="question-mark">?</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// P2PKH template. Expands to a descriptor `pkh(key)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::P2PKH;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key =</span>
+<span class="doccomment">/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// P2PKH(key),</span>
+<span class="doccomment">/// None,</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default(),</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(</span>
+<span class="doccomment">/// wallet.get_new_address()?.to_string(),</span>
+<span class="doccomment">/// "mwJ8hxFYW19JLuc65RCTaP4v1rzVU8cVMT"</span>
+<span class="doccomment">/// );</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">P2PKH</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">P2PKH</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">pkh</span>(<span class="self">self</span>.<span class="number">0</span>))<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// P2WPKH-P2SH template. Expands to a descriptor `sh(wpkh(key))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::P2WPKH_P2SH;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key =</span>
+<span class="doccomment">/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// P2WPKH_P2SH(key),</span>
+<span class="doccomment">/// None,</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default(),</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(</span>
+<span class="doccomment">/// wallet.get_new_address()?.to_string(),</span>
+<span class="doccomment">/// "2NB4ox5VDRw1ecUv6SnT3VQHPXveYztRqk5"</span>
+<span class="doccomment">/// );</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">non_camel_case_types</span>)]</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">P2WPKH_P2SH</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">P2WPKH_P2SH</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">wpkh</span>(<span class="self">self</span>.<span class="number">0</span>)))<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// P2WPKH template. Expands to a descriptor `wpkh(key)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Example</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// # use bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::P2WPKH;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key =</span>
+<span class="doccomment">/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// P2WPKH(key),</span>
+<span class="doccomment">/// None,</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default(),</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(</span>
+<span class="doccomment">/// wallet.get_new_address()?.to_string(),</span>
+<span class="doccomment">/// "tb1q4525hmgw265tl3drrl8jjta7ayffu6jf68ltjd"</span>
+<span class="doccomment">/// );</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">P2WPKH</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">P2WPKH</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="self">self</span>.<span class="number">0</span>))<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP44 template. Expands to `pkh(key/44'/0'/0'/{0,1}/*)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Since there are hardened derivation steps, this template requires a private derivable key (generally a `xprv`/`tprv`).</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP44Public`] for a template that can work with a `xpub`/`tpub`.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP44;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPrivKey::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP44(key.clone(), KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP44(key, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "miNG7dJTzJqNbFS19svRdTCisC65dsubtR");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP44</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP44</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2PKH</span>(<span class="ident">legacy</span>::<span class="ident">make_bipxx_private</span>(<span class="number">44</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP44 public template. Expands to `pkh(key/{0,1}/*)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This assumes that the key used has already been derived with `m/44'/0'/0'`.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP44`] for a template that does the full derivation, but requires private data</span>
+<span class="doccomment">/// for the key.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP44Public;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPubKey::from_str("tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU")?;</span>
+<span class="doccomment">/// let fingerprint = bitcoin::util::bip32::Fingerprint::from_str("c55b303f")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP44Public(key.clone(), fingerprint, KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP44Public(key, fingerprint, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "miNG7dJTzJqNbFS19svRdTCisC65dsubtR");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP44Public</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">bip32</span>::<span class="ident">Fingerprint</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Legacy</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP44Public</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2PKH</span>(<span class="ident">legacy</span>::<span class="ident">make_bipxx_public</span>(<span class="number">44</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>, <span class="self">self</span>.<span class="number">2</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP49 template. Expands to `sh(wpkh(key/49'/0'/0'/{0,1}/*))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Since there are hardened derivation steps, this template requires a private derivable key (generally a `xprv`/`tprv`).</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP49Public`] for a template that can work with a `xpub`/`tpub`.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP49;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPrivKey::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP49(key.clone(), KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP49(key, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49\'/0\'/0\']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP49</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP49</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2WPKH_P2SH</span>(<span class="ident">segwit_v0</span>::<span class="ident">make_bipxx_private</span>(<span class="number">49</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP49 public template. Expands to `sh(wpkh(key/{0,1}/*))`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This assumes that the key used has already been derived with `m/49'/0'/0'`.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP49`] for a template that does the full derivation, but requires private data</span>
+<span class="doccomment">/// for the key.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP49Public;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPubKey::from_str("tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L")?;</span>
+<span class="doccomment">/// let fingerprint = bitcoin::util::bip32::Fingerprint::from_str("c55b303f")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP49Public(key.clone(), fingerprint, KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP49Public(key, fingerprint, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49\'/0\'/0\']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP49Public</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">bip32</span>::<span class="ident">Fingerprint</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP49Public</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2WPKH_P2SH</span>(<span class="ident">segwit_v0</span>::<span class="ident">make_bipxx_public</span>(<span class="number">49</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>, <span class="self">self</span>.<span class="number">2</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP84 template. Expands to `wpkh(key/84'/0'/0'/{0,1}/*)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Since there are hardened derivation steps, this template requires a private derivable key (generally a `xprv`/`tprv`).</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP84Public`] for a template that can work with a `xpub`/`tpub`.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP84;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPrivKey::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP84(key.clone(), KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP84(key, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP84</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP84</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2WPKH</span>(<span class="ident">segwit_v0</span>::<span class="ident">make_bipxx_private</span>(<span class="number">84</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="doccomment">/// BIP84 public template. Expands to `wpkh(key/{0,1}/*)`</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This assumes that the key used has already been derived with `m/84'/0'/0'`.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This template requires the parent fingerprint to populate correctly the metadata of PSBTs.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// See [`BIP84`] for a template that does the full derivation, but requires private data</span>
+<span class="doccomment">/// for the key.</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 bdk::bitcoin::{PrivateKey, Network};</span>
+<span class="doccomment">/// # use bdk::{Wallet, OfflineWallet, KeychainKind};</span>
+<span class="doccomment">/// # use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">/// use bdk::template::BIP84Public;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = bitcoin::util::bip32::ExtendedPubKey::from_str("tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q")?;</span>
+<span class="doccomment">/// let fingerprint = bitcoin::util::bip32::Fingerprint::from_str("c55b303f")?;</span>
+<span class="doccomment">/// let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">/// BIP84Public(key.clone(), fingerprint, KeychainKind::External),</span>
+<span class="doccomment">/// Some(BIP84Public(key, fingerprint, KeychainKind::Internal)),</span>
+<span class="doccomment">/// Network::Testnet,</span>
+<span class="doccomment">/// MemoryDatabase::default()</span>
+<span class="doccomment">/// )?;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// assert_eq!(wallet.get_new_address()?.to_string(), "tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7");</span>
+<span class="doccomment">/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)");</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BIP84Public</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span>(<span class="kw">pub</span> <span class="ident">K</span>, <span class="kw">pub</span> <span class="ident">bip32</span>::<span class="ident">Fingerprint</span>, <span class="kw">pub</span> <span class="ident">KeychainKind</span>);
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Segwitv0</span><span class="op">></span><span class="op">></span> <span class="ident">DescriptorTemplate</span> <span class="kw">for</span> <span class="ident">BIP84Public</span><span class="op"><</span><span class="ident">K</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">build</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">DescriptorTemplateOut</span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="ident">P2WPKH</span>(<span class="ident">segwit_v0</span>::<span class="ident">make_bipxx_public</span>(<span class="number">84</span>, <span class="self">self</span>.<span class="number">0</span>, <span class="self">self</span>.<span class="number">1</span>, <span class="self">self</span>.<span class="number">2</span>)<span class="question-mark">?</span>).<span class="ident">build</span>()<span class="question-mark">?</span>)
+ }
+}
+
+<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">expand_make_bipxx</span> {
+ ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">mod_name</span>:<span class="ident">ident</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span>:<span class="ident">ty</span> ) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">mod</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">mod_name</span> {
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn</span> <span class="ident">make_bipxx_private</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span><span class="op">></span><span class="op">></span>(
+ <span class="ident">bip</span>: <span class="ident">u32</span>,
+ <span class="ident">key</span>: <span class="ident">K</span>,
+ <span class="ident">keychain</span>: <span class="ident">KeychainKind</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">impl</span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">derivation_path</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">4</span>);
+ <span class="ident">derivation_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="ident">bip</span>)<span class="question-mark">?</span>);
+ <span class="ident">derivation_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>);
+ <span class="ident">derivation_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>);
+
+ <span class="kw">match</span> <span class="ident">keychain</span> {
+ <span class="ident">KeychainKind</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">derivation_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>)
+ }
+ <span class="ident">KeychainKind</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">derivation_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">1</span>)<span class="question-mark">?</span>)
+ }
+ };
+
+ <span class="kw">let</span> <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span> <span class="op">=</span> <span class="ident">derivation_path</span>.<span class="ident">into</span>();
+
+ <span class="prelude-val">Ok</span>((<span class="ident">key</span>, <span class="ident">derivation_path</span>))
+ }
+ <span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn</span> <span class="ident">make_bipxx_public</span><span class="op"><</span><span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span><span class="op">></span><span class="op">></span>(
+ <span class="ident">bip</span>: <span class="ident">u32</span>,
+ <span class="ident">key</span>: <span class="ident">K</span>,
+ <span class="ident">parent_fingerprint</span>: <span class="ident">bip32</span>::<span class="ident">Fingerprint</span>,
+ <span class="ident">keychain</span>: <span class="ident">KeychainKind</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="kw">impl</span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">keychain</span> {
+ <span class="ident">KeychainKind</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>].<span class="ident">into</span>(),
+ <span class="ident">KeychainKind</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">1</span>)<span class="question-mark">?</span>].<span class="ident">into</span>(),
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">source_path</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">3</span>);
+ <span class="ident">source_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="ident">bip</span>)<span class="question-mark">?</span>);
+ <span class="ident">source_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>);
+ <span class="ident">source_path</span>.<span class="ident">push</span>(<span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">from_hardened_idx</span>(<span class="number">0</span>)<span class="question-mark">?</span>);
+ <span class="kw">let</span> <span class="ident">source_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span> <span class="op">=</span> <span class="ident">source_path</span>.<span class="ident">into</span>();
+
+ <span class="prelude-val">Ok</span>((<span class="ident">key</span>, (<span class="ident">parent_fingerprint</span>, <span class="ident">source_path</span>), <span class="ident">derivation_path</span>))
+ }
+ }
+ };
+}
+
+<span class="macro">expand_make_bipxx</span><span class="macro">!</span>(<span class="ident">legacy</span>, <span class="ident">Legacy</span>);
+<span class="macro">expand_make_bipxx</span><span class="macro">!</span>(<span class="ident">segwit_v0</span>, <span class="ident">Segwitv0</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="comment">// test existing descriptor templates, make sure they are expanded to the right descriptors</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">descriptor</span>::<span class="ident">DescriptorMeta</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">KeyError</span>, <span class="ident">ValidNetworks</span>};
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">hashes</span>::<span class="ident">core</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">constants</span>::<span class="ident">Network</span>::<span class="ident">Regtest</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="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorPublicKey</span>, <span class="ident">DescriptorPublicKeyCtx</span>, <span class="ident">KeyMap</span>};
+ <span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">Descriptor</span>;
+
+ <span class="comment">// verify template descriptor generates expected address(es)</span>
+ <span class="kw">fn</span> <span class="ident">check</span>(
+ <span class="ident">desc</span>: <span class="prelude-ty">Result</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">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span>,
+ <span class="ident">is_witness</span>: <span class="ident">bool</span>,
+ <span class="ident">is_fixed</span>: <span class="ident">bool</span>,
+ <span class="ident">expected</span>: <span class="kw-2">&</span>[<span class="kw-2">&</span><span class="ident">str</span>],
+ ) {
+ <span class="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span>
+ <span class="ident">DescriptorPublicKeyCtx</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">secp</span>, <span class="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="number">0</span>).<span class="ident">unwrap</span>());
+
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">_key_map</span>, <span class="ident">_networks</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_witness</span>(), <span class="ident">is_witness</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">is_fixed</span>(), <span class="ident">is_fixed</span>);
+ <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">expected</span>.<span class="ident">len</span>() {
+ <span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">i</span> <span class="kw">as</span> <span class="ident">u32</span>;
+ <span class="kw">let</span> <span class="ident">child_desc</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">desc</span>.<span class="ident">is_fixed</span>() {
+ <span class="ident">desc</span>.<span class="ident">clone</span>()
+ } <span class="kw">else</span> {
+ <span class="ident">desc</span>.<span class="ident">derive</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="kw">let</span> <span class="ident">address</span> <span class="op">=</span> <span class="ident">child_desc</span>.<span class="ident">address</span>(<span class="ident">Regtest</span>, <span class="ident">deriv_ctx</span>).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">address</span>.<span class="ident">to_string</span>(), <span class="kw-2">*</span><span class="ident">expected</span>.<span class="ident">get</span>(<span class="ident">i</span>).<span class="ident">unwrap</span>());
+ }
+ }
+
+ <span class="comment">// P2PKH</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_p2ph_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</span>)
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2PKH</span>(<span class="ident">prvkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"mwJ8hxFYW19JLuc65RCTaP4v1rzVU8cVMT"</span>],
+ );
+
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2PKH</span>(<span class="ident">pubkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"muZpTpBYhxmRFuCjLc7C6BBDF32C8XVJUi"</span>],
+ );
+ }
+
+ <span class="comment">// P2WPKH-P2SH `sh(wpkh(key))`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_p2wphp2sh_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</span>)
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2WPKH_P2SH</span>(<span class="ident">prvkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2NB4ox5VDRw1ecUv6SnT3VQHPXveYztRqk5"</span>],
+ );
+
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2WPKH_P2SH</span>(<span class="ident">pubkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"2N5LiC3CqzxDamRTPG1kiNv1FpNJQ7x28sb"</span>],
+ );
+ }
+
+ <span class="comment">// P2WPKH `wpkh(key)`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_p2wph_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">from_wif</span>(<span class="string">"cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um"</span>)
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2WPKH</span>(<span class="ident">prvkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"bcrt1q4525hmgw265tl3drrl8jjta7ayffu6jfcwxx9y"</span>],
+ );
+
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">PublicKey</span>::<span class="ident">from_str</span>(
+ <span class="string">"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd"</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">P2WPKH</span>(<span class="ident">pubkey</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">true</span>,
+ <span class="kw-2">&</span>[<span class="string">"bcrt1qngw83fg8dz0k749cg7k3emc7v98wy0c7azaa6h"</span>],
+ );
+ }
+
+ <span class="comment">// BIP44 `pkh(key/44'/0'/0'/{0,1}/*)`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip44_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP44</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"n453VtnjDHPyDt2fDstKSu7A3YCJoHZ5g5"</span>,
+ <span class="string">"mvfrrumXgTtwFPWDNUecBBgzuMXhYM7KRP"</span>,
+ <span class="string">"mzYvhRAuQqbdSKMVVzXNYyqihgNdRadAUQ"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP44</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"muHF98X9KxEzdKrnFAX85KeHv96eXopaip"</span>,
+ <span class="string">"n4hpyLJE5ub6B5Bymv4eqFxS5KjrewSmYR"</span>,
+ <span class="string">"mgvkdv1ffmsXd2B1sRKQ5dByK3SzpG42rA"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// BIP44 public `pkh(key/{0,1}/*)`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip44_public_template</span>() {
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP44Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"miNG7dJTzJqNbFS19svRdTCisC65dsubtR"</span>,
+ <span class="string">"n2UqaDbCjWSFJvpC84m3FjUk5UaeibCzYg"</span>,
+ <span class="string">"muCPpS6Ue7nkzeJMWDViw7Lkwr92Yc4K8g"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP44Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">false</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"moDr3vJ8wpt5nNxSK55MPq797nXJb2Ru9H"</span>,
+ <span class="string">"ms7A1Yt4uTezT2XkefW12AvLoko8WfNJMG"</span>,
+ <span class="string">"mhYiyat2rtEnV77cFfQsW32y1m2ceCGHPo"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// BIP49 `sh(wpkh(key/49'/0'/0'/{0,1}/*))`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip49_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP49</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2N9bCAJXGm168MjVwpkBdNt6ucka3PKVoUV"</span>,
+ <span class="string">"2NDckYkqrYyDMtttEav5hB3Bfw9EGAW5HtS"</span>,
+ <span class="string">"2NAFTVtksF9T4a97M7nyCjwUBD24QevZ5Z4"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP49</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2NB3pA8PnzJLGV8YEKNDFpbViZv3Bm1K6CG"</span>,
+ <span class="string">"2NBiX2Wzxngb5rPiWpUiJQ2uLVB4HBjFD4p"</span>,
+ <span class="string">"2NA8ek4CdQ6aMkveYF6AYuEYNrftB47QGTn"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// BIP49 public `sh(wpkh(key/{0,1}/*))`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip49_public_template</span>() {
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP49Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt"</span>,
+ <span class="string">"2NCTQfJ1sZa3wQ3pPseYRHbaNEpC3AquEfX"</span>,
+ <span class="string">"2MveFxAuC8BYPzTybx7FxSzW8HSd8ATT4z7"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP49Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"2NF2vttKibwyxigxtx95Zw8K7JhDbo5zPVJ"</span>,
+ <span class="string">"2Mtmyd8taksxNVWCJ4wVvaiss7QPZGcAJuH"</span>,
+ <span class="string">"2NBs3CTVYPr1HCzjB4YFsnWCPCtNg8uMEfp"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// BIP84 `wpkh(key/84'/0'/0'/{0,1}/*)`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip84_template</span>() {
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="string">"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP84</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qkmvk2nadgplmd57ztld8nf8v2yxkzmdvwtjf8s"</span>,
+ <span class="string">"bcrt1qx0v6zgfwe50m4kqc58cqzcyem7ay2sfl3gvqhp"</span>,
+ <span class="string">"bcrt1q4h7fq9zhxst6e69p3n882nfj649l7w9g3zccfp"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP84</span>(<span class="ident">prvkey</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qtrwtz00wxl69e5xex7amy4xzlxkaefg3gfdkxa"</span>,
+ <span class="string">"bcrt1qqqasfhxpkkf7zrxqnkr2sfhn74dgsrc3e3ky45"</span>,
+ <span class="string">"bcrt1qpks7n0gq74hsgsz3phn5vuazjjq0f5eqhsgyce"</span>,
+ ],
+ );
+ }
+
+ <span class="comment">// BIP84 public `wpkh(key/{0,1}/*)`</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bip84_public_template</span>() {
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_str</span>(<span class="string">"tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q"</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>::<span class="ident">Fingerprint</span>::<span class="ident">from_str</span>(<span class="string">"c55b303f"</span>).<span class="ident">unwrap</span>();
+ <span class="ident">check</span>(
+ <span class="ident">BIP84Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2prcdvd0h"</span>,
+ <span class="string">"bcrt1q3lncdlwq3lgcaaeyruynjnlccr0ve0kakh6ana"</span>,
+ <span class="string">"bcrt1qt9800y6xl3922jy3uyl0z33jh5wfpycyhcylr9"</span>,
+ ],
+ );
+ <span class="ident">check</span>(
+ <span class="ident">BIP84Public</span>(<span class="ident">pubkey</span>, <span class="ident">fingerprint</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>).<span class="ident">build</span>(),
+ <span class="bool-val">true</span>,
+ <span class="bool-val">false</span>,
+ <span class="kw-2">&</span>[
+ <span class="string">"bcrt1qm6wqukenh7guu792lj2njgw9n78cmwsy8xy3z2"</span>,
+ <span class="string">"bcrt1q694twxtjn4nnrvnyvra769j0a23rllj5c6cgwp"</span>,
+ <span class="string">"bcrt1qhlac3c5ranv5w5emlnqs7wxhkxt8maelylcarp"</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 of the Rust file `src/error.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>error.rs - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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="kw">crate</span>::{<span class="ident">descriptor</span>, <span class="ident">wallet</span>, <span class="ident">wallet</span>::<span class="ident">address_validator</span>};
+<span class="kw">use</span> <span class="ident">bitcoin</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="doccomment">/// Wrong number of bytes found when trying to convert to u32</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="doccomment">/// Generic error</span>
+ <span class="ident">Generic</span>(<span class="ident">String</span>),
+ <span class="doccomment">/// This error is thrown when trying to convert Bare and Public key script to address</span>
+ <span class="ident">ScriptDoesntHaveAddressForm</span>,
+ <span class="doccomment">/// Found multiple outputs when `single_recipient` option has been specified</span>
+ <span class="ident">SingleRecipientMultipleOutputs</span>,
+ <span class="doccomment">/// `single_recipient` option is selected but neither `drain_wallet` nor `manually_selected_only` are</span>
+ <span class="ident">SingleRecipientNoInputs</span>,
+ <span class="doccomment">/// Cannot build a tx without recipients</span>
+ <span class="ident">NoRecipients</span>,
+ <span class="doccomment">/// `manually_selected_only` option is selected but no utxo has been passed</span>
+ <span class="ident">NoUtxosSelected</span>,
+ <span class="doccomment">/// Output created is under the dust limit, 546 satoshis</span>
+ <span class="ident">OutputBelowDustLimit</span>(<span class="ident">usize</span>),
+ <span class="doccomment">/// Wallet's UTXO set is not enough to cover recipient's requested plus fee</span>
+ <span class="ident">InsufficientFunds</span>,
+ <span class="doccomment">/// Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow</span>
+ <span class="doccomment">/// exponentially, thus a limit is set, and when hit, this error is thrown</span>
+ <span class="ident">BnBTotalTriesExceeded</span>,
+ <span class="doccomment">/// Branch and bound coin selection tries to avoid needing a change by finding the right inputs for</span>
+ <span class="doccomment">/// the desired outputs plus fee, if there is not such combination this error is thrown</span>
+ <span class="ident">BnBNoExactMatch</span>,
+ <span class="doccomment">/// Happens when trying to spend an UTXO that is not in the internal database</span>
+ <span class="ident">UnknownUTXO</span>,
+ <span class="doccomment">/// Thrown when a tx is not found in the internal database</span>
+ <span class="ident">TransactionNotFound</span>,
+ <span class="doccomment">/// Happens when trying to bump a transaction that is already confirmed</span>
+ <span class="ident">TransactionConfirmed</span>,
+ <span class="doccomment">/// Trying to replace a tx that has a sequence >= `0xFFFFFFFE`</span>
+ <span class="ident">IrreplaceableTransaction</span>,
+ <span class="doccomment">/// When bumping a tx the fee rate requested is lower than required</span>
+ <span class="ident">FeeRateTooLow</span> {
+ <span class="doccomment">/// Required fee rate (satoshi/vbyte)</span>
+ <span class="ident">required</span>: <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">FeeRate</span>,
+ },
+ <span class="doccomment">/// When bumping a tx the absolute fee requested is lower than replaced tx absolute fee</span>
+ <span class="ident">FeeTooLow</span> {
+ <span class="doccomment">/// Required fee absolute value (satoshi)</span>
+ <span class="ident">required</span>: <span class="ident">u64</span>,
+ },
+ <span class="doccomment">/// In order to use the [`TxBuilder::add_global_xpubs`] option every extended</span>
+ <span class="doccomment">/// key in the descriptor must either be a master key itself (having depth = 0) or have an</span>
+ <span class="doccomment">/// explicit origin provided</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// [`TxBuilder::add_global_xpubs`]: crate::wallet::tx_builder::TxBuilder::add_global_xpubs</span>
+ <span class="ident">MissingKeyOrigin</span>(<span class="ident">String</span>),
+ <span class="doccomment">/// Error while working with [`keys`](crate::keys)</span>
+ <span class="ident">Key</span>(<span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>),
+ <span class="doccomment">/// Descriptor checksum mismatch</span>
+ <span class="ident">ChecksumMismatch</span>,
+ <span class="doccomment">/// Spending policy is not compatible with this [`KeychainKind`](crate::types::KeychainKind)</span>
+ <span class="ident">SpendingPolicyRequired</span>(<span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">KeychainKind</span>),
+ <span class="doccomment">/// Error while extracting and manipulating policies</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="doccomment">/// Signing error</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="doccomment">/// Thrown when trying to call a method that requires a network connection, [`Wallet::sync`](crate::Wallet::sync) and [`Wallet::broadcast`](crate::Wallet::broadcast)</span>
+ <span class="doccomment">/// This error is thrown when creating the Client for the first time, while recovery attempts are tried</span>
+ <span class="doccomment">/// during the sync</span>
+ <span class="ident">OfflineClient</span>,
+ <span class="doccomment">/// Progress value must be between `0.0` (included) and `100.0` (included)</span>
+ <span class="ident">InvalidProgressValue</span>(<span class="ident">f32</span>),
+ <span class="doccomment">/// Progress update error (maybe the channel has been closed)</span>
+ <span class="ident">ProgressUpdateError</span>,
+ <span class="doccomment">/// Requested outpoint doesn't exist in the tx (vout greater than available outputs)</span>
+ <span class="ident">InvalidOutpoint</span>(<span class="ident">OutPoint</span>),
+
+ <span class="doccomment">/// Error related to the parsing and usage of descriptors</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="doccomment">/// Error that can be returned to fail the validation of an address</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="doccomment">/// Encoding error</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="doccomment">/// Miniscript error</span>
+ <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// BIP32 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="doccomment">/// An ECDSA error</span>
+ <span class="ident">Secp256k1</span>(<span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Error serializing or deserializing JSON data</span>
+ <span class="ident">JSON</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>),
+ <span class="doccomment">/// Hex decoding 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="doccomment">/// Partially signed bitcoin transaction 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="comment">//KeyMismatch(bitcoin::secp256k1::PublicKey, bitcoin::secp256k1::PublicKey),</span>
+ <span class="comment">//MissingInputUTXO(usize),</span>
+ <span class="comment">//InvalidAddressNetwork(Address),</span>
+ <span class="comment">//DifferentTransactions,</span>
+ <span class="comment">//DifferentDescriptorStructure,</span>
+ <span class="comment">//Uncapable(crate::blockchain::Capability),</span>
+ <span class="comment">//MissingCachedAddresses,</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="doccomment">/// Electrum client error</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="doccomment">/// Esplora client error</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="doccomment">/// Compact filters client error)</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="doccomment">/// Sled database error</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="macro">impl_error</span><span class="macro">!</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">from</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">to</span>, <span class="ident">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="macro-nonterminal">$</span><span class="macro-nonterminal">impl_for</span>:<span class="ident">ty</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="macro-nonterminal">$</span><span class="macro-nonterminal">impl_for</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="op"><</span><span class="macro-nonterminal">$</span><span class="macro-nonterminal">impl_for</span><span class="op">></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">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="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="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="ident">wallet</span>::<span class="ident">signer</span>::<span class="ident">SignerError</span>, <span class="ident">Signer</span>);
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</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">key_error</span>: <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Error</span> {
+ <span class="kw">match</span> <span class="ident">key_error</span> {
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>::<span class="ident">Miniscript</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">Miniscript</span>(<span class="ident">inner</span>),
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>::<span class="ident">BIP32</span>(<span class="ident">inner</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">BIP32</span>(<span class="ident">inner</span>),
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">KeyError</span>::<span class="ident">InvalidChecksum</span> <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">ChecksumMismatch</span>,
+ <span class="ident">e</span> <span class="op">=</span><span class="op">></span> <span class="ident">Error</span>::<span class="ident">Key</span>(<span class="ident">e</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 of the Rust file `src/keys/bip39.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>bip39.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! BIP-0039</span>
+
+<span class="comment">// TODO: maybe write our own implementation of bip39? Seems stupid to have an extra dependency for</span>
+<span class="comment">// something that should be fairly simple to re-implement.</span>
+
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>;
+<span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
+
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">ScriptContext</span>;
+
+<span class="kw">use</span> <span class="ident">bip39</span>::{<span class="ident">Language</span>, <span class="ident">Mnemonic</span>, <span class="ident">MnemonicType</span>, <span class="ident">Seed</span>};
+
+<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">any_network</span>, <span class="ident">DerivableKey</span>, <span class="ident">DescriptorKey</span>, <span class="ident">GeneratableKey</span>, <span class="ident">GeneratedKey</span>, <span class="ident">KeyError</span>};
+
+<span class="doccomment">/// Type for a BIP39 mnemonic with an optional passphrase</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">MnemonicWithPassphrase</span> <span class="op">=</span> (<span class="ident">Mnemonic</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></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">"keys-bip39"</span>)))]</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">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Seed</span> {
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">source</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">new_master</span>(<span class="ident">Network</span>::<span class="ident">Bitcoin</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">as_bytes</span>())<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">descriptor_key</span> <span class="op">=</span> <span class="ident">xprv</span>.<span class="ident">add_metadata</span>(<span class="ident">source</span>, <span class="ident">derivation_path</span>)<span class="question-mark">?</span>;
+
+ <span class="comment">// here we must choose one network to build the xpub, but since the bip39 standard doesn't</span>
+ <span class="comment">// encode the network, the xpub we create is actually valid everywhere. so we override the</span>
+ <span class="comment">// valid networks with `any_network()`.</span>
+ <span class="prelude-val">Ok</span>(<span class="ident">descriptor_key</span>.<span class="ident">override_valid_networks</span>(<span class="ident">any_network</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">"keys-bip39"</span>)))]</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">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MnemonicWithPassphrase</span> {
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">source</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">mnemonic</span>, <span class="ident">passphrase</span>) <span class="op">=</span> <span class="self">self</span>;
+ <span class="kw">let</span> <span class="ident">seed</span> <span class="op">=</span> <span class="ident">Seed</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">mnemonic</span>, <span class="ident">passphrase</span>.<span class="ident">as_deref</span>().<span class="ident">unwrap_or</span>(<span class="string">""</span>));
+ <span class="ident">seed</span>.<span class="ident">add_metadata</span>(<span class="ident">source</span>, <span class="ident">derivation_path</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">"keys-bip39"</span>)))]</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">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Mnemonic</span> {
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">source</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ (<span class="self">self</span>, <span class="prelude-val">None</span>).<span class="ident">add_metadata</span>(<span class="ident">source</span>, <span class="ident">derivation_path</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">"keys-bip39"</span>)))]</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">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Mnemonic</span> {
+ <span class="kw">type</span> <span class="ident">Entropy</span> <span class="op">=</span> [<span class="ident">u8</span>; <span class="number">32</span>];
+
+ <span class="kw">type</span> <span class="ident">Options</span> <span class="op">=</span> (<span class="ident">MnemonicType</span>, <span class="ident">Language</span>);
+ <span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip39</span>::<span class="ident">ErrorKind</span><span class="op">></span>;
+
+ <span class="kw">fn</span> <span class="ident">generate_with_entropy</span>(
+ (<span class="ident">mnemonic_type</span>, <span class="ident">language</span>): <span class="self">Self</span>::<span class="ident">Options</span>,
+ <span class="ident">entropy</span>: <span class="self">Self</span>::<span class="ident">Entropy</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</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="ident">entropy</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">entropy</span>.<span class="ident">as_ref</span>()[..(<span class="ident">mnemonic_type</span>.<span class="ident">entropy_bits</span>() <span class="op">/</span> <span class="number">8</span>)];
+ <span class="kw">let</span> <span class="ident">mnemonic</span> <span class="op">=</span> <span class="ident">Mnemonic</span>::<span class="ident">from_entropy</span>(<span class="ident">entropy</span>, <span class="ident">language</span>).<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">e</span>.<span class="ident">downcast</span>().<span class="ident">ok</span>())<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">GeneratedKey</span>::<span class="ident">new</span>(<span class="ident">mnemonic</span>, <span class="ident">any_network</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">util</span>::<span class="ident">bip32</span>;
+
+ <span class="kw">use</span> <span class="ident">bip39</span>::{<span class="ident">Language</span>, <span class="ident">Mnemonic</span>, <span class="ident">MnemonicType</span>};
+
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">any_network</span>, <span class="ident">GeneratableKey</span>, <span class="ident">GeneratedKey</span>};
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_bip39_mnemonic</span>() {
+ <span class="kw">let</span> <span class="ident">mnemonic</span> <span class="op">=</span>
+ <span class="string">"aim bunker wash balance finish force paper analyst cabin spoon stable organ"</span>;
+ <span class="kw">let</span> <span class="ident">mnemonic</span> <span class="op">=</span> <span class="ident">Mnemonic</span>::<span class="ident">from_phrase</span>(<span class="ident">mnemonic</span>, <span class="ident">Language</span>::<span class="ident">English</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> (<span class="ident">mnemonic</span>, <span class="ident">path</span>);
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">keys</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">key</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">to_string</span>(), <span class="string">"wpkh([be83839f/44'/0'/0']xpub6DCQ1YcqvZtSwGWMrwHELPehjWV3f2MGZ69yBADTxFEUAoLwb5Mp5GniQK6tTp3AgbngVz9zEFbBJUPVnkG7LFYt8QMTfbrNqs6FNEwAPKA/0/*)"</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">keys</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">networks</span>.<span class="ident">len</span>(), <span class="number">3</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_bip39_mnemonic_passphrase</span>() {
+ <span class="kw">let</span> <span class="ident">mnemonic</span> <span class="op">=</span>
+ <span class="string">"aim bunker wash balance finish force paper analyst cabin spoon stable organ"</span>;
+ <span class="kw">let</span> <span class="ident">mnemonic</span> <span class="op">=</span> <span class="ident">Mnemonic</span>::<span class="ident">from_phrase</span>(<span class="ident">mnemonic</span>, <span class="ident">Language</span>::<span class="ident">English</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="string">"m/44'/0'/0'/0"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> ((<span class="ident">mnemonic</span>, <span class="prelude-val">Some</span>(<span class="string">"passphrase"</span>.<span class="ident">into</span>())), <span class="ident">path</span>);
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">keys</span>, <span class="ident">networks</span>) <span class="op">=</span> <span class="kw">crate</span>::<span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">wpkh</span>(<span class="ident">key</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">desc</span>.<span class="ident">to_string</span>(), <span class="string">"wpkh([8f6cb80c/44'/0'/0']xpub6DWYS8bbihFevy29M4cbw4ZR3P5E12jB8R88gBDWCTCNpYiDHhYWNywrCF9VZQYagzPmsZpxXpytzSoxynyeFr4ZyzheVjnpLKuse4fiwZw/0/*)"</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">keys</span>.<span class="ident">len</span>(), <span class="number">1</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">networks</span>.<span class="ident">len</span>(), <span class="number">3</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_generate_bip39</span>() {
+ <span class="kw">let</span> <span class="ident">generated_mnemonic</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Mnemonic</span>::<span class="ident">generate_with_entropy</span>(
+ (<span class="ident">MnemonicType</span>::<span class="ident">Words12</span>, <span class="ident">Language</span>::<span class="ident">English</span>),
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">test</span>::<span class="ident">TEST_ENTROPY</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_mnemonic</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</span>());
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">generated_mnemonic</span>.<span class="ident">to_string</span>(),
+ <span class="string">"primary fetch primary fetch primary fetch primary fetch primary fetch primary fever"</span>
+ );
+
+ <span class="kw">let</span> <span class="ident">generated_mnemonic</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Mnemonic</span>::<span class="ident">generate_with_entropy</span>(
+ (<span class="ident">MnemonicType</span>::<span class="ident">Words24</span>, <span class="ident">Language</span>::<span class="ident">English</span>),
+ <span class="kw">crate</span>::<span class="ident">keys</span>::<span class="ident">test</span>::<span class="ident">TEST_ENTROPY</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_mnemonic</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</span>());
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_mnemonic</span>.<span class="ident">to_string</span>(), <span class="string">"primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary foster"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_generate_bip39_random</span>() {
+ <span class="kw">let</span> <span class="ident">generated_mnemonic</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Mnemonic</span>::<span class="ident">generate</span>((<span class="ident">MnemonicType</span>::<span class="ident">Words12</span>, <span class="ident">Language</span>::<span class="ident">English</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_mnemonic</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</span>());
+
+ <span class="kw">let</span> <span class="ident">generated_mnemonic</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">Mnemonic</span>::<span class="ident">generate</span>((<span class="ident">MnemonicType</span>::<span class="ident">Words24</span>, <span class="ident">Language</span>::<span class="ident">English</span>)).<span class="ident">unwrap</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_mnemonic</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</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 of the Rust file `src/keys/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! Key formats</span>
+
+<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">any</span>::<span class="ident">TypeId</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">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">bitcoin</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="kw">use</span> <span class="ident">bitcoin</span>::{<span class="ident">Network</span>, <span class="ident">PrivateKey</span>, <span class="ident">PublicKey</span>};
+
+<span class="kw">pub</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">DescriptorSinglePriv</span>, <span class="ident">DescriptorSinglePub</span>,
+ <span class="ident">SortedMultiVec</span>,
+};
+<span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::{<span class="ident">DescriptorXKey</span>, <span class="ident">KeyMap</span>};
+<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">ScriptContext</span>;
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">Miniscript</span>, <span class="ident">Terminal</span>};
+
+<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">wallet</span>::<span class="ident">utils</span>::<span class="ident">SecpCtx</span>;
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"keys-bip39"</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">"keys-bip39"</span>)))]</span>
+<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">bip39</span>;
+
+<span class="doccomment">/// Set of valid networks for a key</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">ValidNetworks</span> <span class="op">=</span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">Network</span><span class="op">></span>;
+
+<span class="doccomment">/// Create a set containing mainnet, testnet and regtest</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">any_network</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ValidNetworks</span> {
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Network</span>::<span class="ident">Bitcoin</span>, <span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">Network</span>::<span class="ident">Regtest</span>]
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">collect</span>()
+}
+<span class="doccomment">/// Create a set only containing mainnet</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">mainnet_network</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ValidNetworks</span> {
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Network</span>::<span class="ident">Bitcoin</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>()
+}
+<span class="doccomment">/// Create a set containing testnet and regtest</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test_networks</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ValidNetworks</span> {
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Network</span>::<span class="ident">Testnet</span>, <span class="ident">Network</span>::<span class="ident">Regtest</span>]
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">collect</span>()
+}
+<span class="doccomment">/// Compute the intersection of two sets</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">merge_networks</span>(<span class="ident">a</span>: <span class="kw-2">&</span><span class="ident">ValidNetworks</span>, <span class="ident">b</span>: <span class="kw-2">&</span><span class="ident">ValidNetworks</span>) <span class="op">-</span><span class="op">></span> <span class="ident">ValidNetworks</span> {
+ <span class="ident">a</span>.<span class="ident">intersection</span>(<span class="ident">b</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>()
+}
+
+<span class="doccomment">/// Container for public or secret keys</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> {
+ <span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+ <span class="ident">Public</span>(<span class="ident">DescriptorPublicKey</span>, <span class="ident">ValidNetworks</span>, <span class="ident">PhantomData</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>),
+ <span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+ <span class="ident">Secret</span>(<span class="ident">DescriptorSecretKey</span>, <span class="ident">ValidNetworks</span>, <span class="ident">PhantomData</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> {
+ <span class="doccomment">/// Create an instance given a public key and a set of valid networks</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_public</span>(<span class="ident">public</span>: <span class="ident">DescriptorPublicKey</span>, <span class="ident">networks</span>: <span class="ident">ValidNetworks</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">DescriptorKey</span>::<span class="ident">Public</span>(<span class="ident">public</span>, <span class="ident">networks</span>, <span class="ident">PhantomData</span>)
+ }
+
+ <span class="doccomment">/// Create an instance given a secret key and a set of valid networks</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_secret</span>(<span class="ident">secret</span>: <span class="ident">DescriptorSecretKey</span>, <span class="ident">networks</span>: <span class="ident">ValidNetworks</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">DescriptorKey</span>::<span class="ident">Secret</span>(<span class="ident">secret</span>, <span class="ident">networks</span>, <span class="ident">PhantomData</span>)
+ }
+
+ <span class="doccomment">/// Override the computed set of valid networks</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">override_valid_networks</span>(<span class="self">self</span>, <span class="ident">networks</span>: <span class="ident">ValidNetworks</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">DescriptorKey</span>::<span class="ident">Public</span>(<span class="ident">key</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">DescriptorKey</span>::<span class="ident">Public</span>(<span class="ident">key</span>, <span class="ident">networks</span>, <span class="ident">PhantomData</span>),
+ <span class="ident">DescriptorKey</span>::<span class="ident">Secret</span>(<span class="ident">key</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">DescriptorKey</span>::<span class="ident">Secret</span>(<span class="ident">key</span>, <span class="ident">networks</span>, <span class="ident">PhantomData</span>),
+ }
+ }
+
+ <span class="comment">// This method is used internally by `bdk::fragment!` and `bdk::descriptor!`. It has to be</span>
+ <span class="comment">// public because it is effectively called by external crates, once the macros are expanded,</span>
+ <span class="comment">// but since it is not meant to be part of the public api we hide it from the docs.</span>
+ <span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">extract</span>(
+ <span class="self">self</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">DescriptorPublicKey</span>, <span class="ident">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">DescriptorKey</span>::<span class="ident">Public</span>(<span class="ident">public</span>, <span class="ident">valid_networks</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>((<span class="ident">public</span>, <span class="ident">KeyMap</span>::<span class="ident">default</span>(), <span class="ident">valid_networks</span>))
+ }
+ <span class="ident">DescriptorKey</span>::<span class="ident">Secret</span>(<span class="ident">secret</span>, <span class="ident">valid_networks</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">key_map</span> <span class="op">=</span> <span class="ident">KeyMap</span>::<span class="ident">with_capacity</span>(<span class="number">1</span>);
+
+ <span class="kw">let</span> <span class="ident">public</span> <span class="op">=</span> <span class="ident">secret</span>
+ .<span class="ident">as_public</span>(<span class="ident">secp</span>)
+ .<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="ident">miniscript</span>::<span class="ident">Error</span>::<span class="ident">Unexpected</span>(<span class="ident">e</span>.<span class="ident">to_string</span>()))<span class="question-mark">?</span>;
+ <span class="ident">key_map</span>.<span class="ident">insert</span>(<span class="ident">public</span>.<span class="ident">clone</span>(), <span class="ident">secret</span>);
+
+ <span class="prelude-val">Ok</span>((<span class="ident">public</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>))
+ }
+ }
+ }
+}
+
+<span class="doccomment">/// Enum representation of the known valid [`ScriptContext`]s</span>
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Copy</span>, <span class="ident">Clone</span>)]</span>
+<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ScriptContextEnum</span> {
+ <span class="doccomment">/// Legacy scripts</span>
+ <span class="ident">Legacy</span>,
+ <span class="doccomment">/// Segwitv0 scripts</span>
+ <span class="ident">Segwitv0</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">ScriptContextEnum</span> {
+ <span class="doccomment">/// Returns whether the script context is [`ScriptContextEnum::Legacy`]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_legacy</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">ScriptContextEnum</span>::<span class="ident">Legacy</span>
+ }
+
+ <span class="doccomment">/// Returns whether the script context is [`ScriptContextEnum::Segwitv0`]</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_segwit_v0</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">ScriptContextEnum</span>::<span class="ident">Segwitv0</span>
+ }
+}
+
+<span class="doccomment">/// Trait that adds extra useful methods to [`ScriptContext`]s</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ExtScriptContext</span>: <span class="ident">ScriptContext</span> {
+ <span class="doccomment">/// Returns the [`ScriptContext`] as a [`ScriptContextEnum`]</span>
+ <span class="kw">fn</span> <span class="ident">as_enum</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ScriptContextEnum</span>;
+
+ <span class="doccomment">/// Returns whether the script context is [`Legacy`](miniscript::Legacy)</span>
+ <span class="kw">fn</span> <span class="ident">is_legacy</span>() <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">Self</span>::<span class="ident">as_enum</span>().<span class="ident">is_legacy</span>()
+ }
+
+ <span class="doccomment">/// Returns whether the script context is [`Segwitv0`](miniscript::Segwitv0)</span>
+ <span class="kw">fn</span> <span class="ident">is_segwit_v0</span>() <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="self">Self</span>::<span class="ident">as_enum</span>().<span class="ident">is_segwit_v0</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="lifetime">'static</span><span class="op">></span> <span class="ident">ExtScriptContext</span> <span class="kw">for</span> <span class="ident">Ctx</span> {
+ <span class="kw">fn</span> <span class="ident">as_enum</span>() <span class="op">-</span><span class="op">></span> <span class="ident">ScriptContextEnum</span> {
+ <span class="kw">match</span> <span class="ident">TypeId</span>::<span class="ident">of</span>::<span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>() {
+ <span class="ident">t</span> <span class="kw">if</span> <span class="ident">t</span> <span class="op">=</span><span class="op">=</span> <span class="ident">TypeId</span>::<span class="ident">of</span>::<span class="op"><</span><span class="ident">miniscript</span>::<span class="ident">Legacy</span><span class="op">></span>() <span class="op">=</span><span class="op">></span> <span class="ident">ScriptContextEnum</span>::<span class="ident">Legacy</span>,
+ <span class="ident">t</span> <span class="kw">if</span> <span class="ident">t</span> <span class="op">=</span><span class="op">=</span> <span class="ident">TypeId</span>::<span class="ident">of</span>::<span class="op"><</span><span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span>() <span class="op">=</span><span class="op">></span> <span class="ident">ScriptContextEnum</span>::<span class="ident">Segwitv0</span>,
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">unimplemented</span><span class="macro">!</span>(<span class="string">"Unknown ScriptContext type"</span>),
+ }
+ }
+}
+
+<span class="doccomment">/// Trait for objects that can be turned into a public or secret [`DescriptorKey`]</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// The generic type `Ctx` is used to define the context in which the key is valid: some key</span>
+<span class="doccomment">/// formats, like the mnemonics used by Electrum wallets, encode internally whether the wallet is</span>
+<span class="doccomment">/// legacy or segwit. Thus, trying to turn a valid legacy mnemonic into a `DescriptorKey`</span>
+<span class="doccomment">/// that would become part of a segwit descriptor should fail.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For key types that do care about this, the [`ExtScriptContext`] trait provides some useful</span>
+<span class="doccomment">/// methods that can be used to check at runtime which `Ctx` is being used.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For key types that can do this check statically (because they can only work within a</span>
+<span class="doccomment">/// single `Ctx`), the "specialized" trait can be implemented to make the compiler handle the type</span>
+<span class="doccomment">/// checking.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Keys also have control over the networks they support: constructing the return object with</span>
+<span class="doccomment">/// [`DescriptorKey::from_public`] or [`DescriptorKey::from_secret`] allows to specify a set of</span>
+<span class="doccomment">/// [`ValidNetworks`].</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ## Examples</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Key type valid in any context:</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// use bdk::bitcoin::PublicKey;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// use bdk::keys::{DescriptorKey, KeyError, ScriptContext, ToDescriptorKey};</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// pub struct MyKeyType {</span>
+<span class="doccomment">/// pubkey: PublicKey,</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// impl<Ctx: ScriptContext> ToDescriptorKey<Ctx> for MyKeyType {</span>
+<span class="doccomment">/// fn to_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError> {</span>
+<span class="doccomment">/// self.pubkey.to_descriptor_key()</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Key type that is only valid on mainnet:</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// use bdk::bitcoin::PublicKey;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// use bdk::keys::{</span>
+<span class="doccomment">/// mainnet_network, DescriptorKey, DescriptorPublicKey, DescriptorSinglePub, KeyError,</span>
+<span class="doccomment">/// ScriptContext, ToDescriptorKey,</span>
+<span class="doccomment">/// };</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// pub struct MyKeyType {</span>
+<span class="doccomment">/// pubkey: PublicKey,</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// impl<Ctx: ScriptContext> ToDescriptorKey<Ctx> for MyKeyType {</span>
+<span class="doccomment">/// fn to_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError> {</span>
+<span class="doccomment">/// Ok(DescriptorKey::from_public(</span>
+<span class="doccomment">/// DescriptorPublicKey::SinglePub(DescriptorSinglePub {</span>
+<span class="doccomment">/// origin: None,</span>
+<span class="doccomment">/// key: self.pubkey,</span>
+<span class="doccomment">/// }),</span>
+<span class="doccomment">/// mainnet_network(),</span>
+<span class="doccomment">/// ))</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Key type that internally encodes in which context it's valid. The context is checked at runtime:</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">/// use bdk::bitcoin::PublicKey;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// use bdk::keys::{DescriptorKey, ExtScriptContext, KeyError, ScriptContext, ToDescriptorKey};</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// pub struct MyKeyType {</span>
+<span class="doccomment">/// is_legacy: bool,</span>
+<span class="doccomment">/// pubkey: PublicKey,</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// impl<Ctx: ScriptContext + 'static> ToDescriptorKey<Ctx> for MyKeyType {</span>
+<span class="doccomment">/// fn to_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError> {</span>
+<span class="doccomment">/// if Ctx::is_legacy() == self.is_legacy {</span>
+<span class="doccomment">/// self.pubkey.to_descriptor_key()</span>
+<span class="doccomment">/// } else {</span>
+<span class="doccomment">/// Err(KeyError::InvalidScriptContext)</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// ```</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Key type that can only work within [`miniscript::Segwitv0`] context. Only the specialized version</span>
+<span class="doccomment">/// of the trait is implemented.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This example deliberately fails to compile, to demonstrate how the compiler can catch when keys</span>
+<span class="doccomment">/// are misused. In this case, the "segwit-only" key is used to build a `pkh()` descriptor, which</span>
+<span class="doccomment">/// makes the compiler (correctly) fail.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// ```compile_fail</span>
+<span class="doccomment">/// use bdk::bitcoin::PublicKey;</span>
+<span class="doccomment">/// use std::str::FromStr;</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// use bdk::keys::{DescriptorKey, KeyError, ToDescriptorKey};</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// pub struct MySegwitOnlyKeyType {</span>
+<span class="doccomment">/// pubkey: PublicKey,</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// impl ToDescriptorKey<bdk::miniscript::Segwitv0> for MySegwitOnlyKeyType {</span>
+<span class="doccomment">/// fn to_descriptor_key(self) -> Result<DescriptorKey<bdk::miniscript::Segwitv0>, KeyError> {</span>
+<span class="doccomment">/// self.pubkey.to_descriptor_key()</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">/// }</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// let key = MySegwitOnlyKeyType {</span>
+<span class="doccomment">/// pubkey: PublicKey::from_str("...")?,</span>
+<span class="doccomment">/// };</span>
+<span class="doccomment">/// let (descriptor, _, _) = bdk::descriptor!(pkh(key))?;</span>
+<span class="doccomment">/// // ^^^^^ changing this to `wpkh` would make it compile</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// # Ok::<_, Box<dyn std::error::Error>>(())</span>
+<span class="doccomment">/// ```</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>: <span class="ident">Sized</span> {
+ <span class="doccomment">/// Turn the key into a [`DescriptorKey`] within the requested [`ScriptContext`]</span>
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span>;
+}
+
+<span class="doccomment">/// Trait for keys that can be derived.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// When extra metadata are provided, a [`DerivableKey`] can be transofrmed into a</span>
+<span class="doccomment">/// [`DescriptorKey`]: the trait [`ToDescriptorKey`] is automatically implemented</span>
+<span class="doccomment">/// for `(DerivableKey, DerivationPath)` and</span>
+<span class="doccomment">/// `(DerivableKey, KeySource, DerivationPath)` tuples.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// For key types that don't encode any indication about the path to use (like bip39), it's</span>
+<span class="doccomment">/// generally recommended to implemented this trait instead of [`ToDescriptorKey`]. The same</span>
+<span class="doccomment">/// rules regarding script context and valid networks apply.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// [`DerivationPath`]: (bip32::DerivationPath)</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> {
+ <span class="doccomment">/// Add a extra metadata, consume `self` and turn it into a [`DescriptorKey`]</span>
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></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">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span> {
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">DescriptorXKey</span> {
+ <span class="ident">origin</span>,
+ <span class="ident">xkey</span>: <span class="self">self</span>,
+ <span class="ident">derivation_path</span>,
+ <span class="ident">is_wildcard</span>: <span class="bool-val">true</span>,
+ })
+ .<span class="ident">to_descriptor_key</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">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span> {
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="ident">DescriptorXKey</span> {
+ <span class="ident">origin</span>,
+ <span class="ident">xkey</span>: <span class="self">self</span>,
+ <span class="ident">derivation_path</span>,
+ <span class="ident">is_wildcard</span>: <span class="bool-val">true</span>,
+ })
+ .<span class="ident">to_descriptor_key</span>()
+ }
+}
+
+<span class="doccomment">/// Output of a [`GeneratableKey`] key generation</span>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">GeneratedKey</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> {
+ <span class="ident">key</span>: <span class="ident">K</span>,
+ <span class="ident">valid_networks</span>: <span class="ident">ValidNetworks</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>,
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> <span class="ident">GeneratedKey</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">key</span>: <span class="ident">K</span>, <span class="ident">valid_networks</span>: <span class="ident">ValidNetworks</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="ident">GeneratedKey</span> {
+ <span class="ident">key</span>,
+ <span class="ident">valid_networks</span>,
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ }
+ }
+
+ <span class="doccomment">/// Consumes `self` and returns the key</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">into_key</span>(<span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">K</span> {
+ <span class="self">self</span>.<span class="ident">key</span>
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span> <span class="ident">Deref</span> <span class="kw">for</span> <span class="ident">GeneratedKey</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span><span class="op">></span> {
+ <span class="kw">type</span> <span class="ident">Target</span> <span class="op">=</span> <span class="ident">K</span>;
+
+ <span class="kw">fn</span> <span class="ident">deref</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="self">Self</span>::<span class="ident">Target</span> {
+ <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">key</span>
+ }
+}
+
+<span class="comment">// Make generated "derivable" keys themselves "derivable". Also make sure they are assigned the</span>
+<span class="comment">// right `valid_networks`.</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>, <span class="ident">K</span><span class="op">></span> <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">GeneratedKey</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>,
+ <span class="ident">K</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>,
+{
+ <span class="kw">fn</span> <span class="ident">add_metadata</span>(
+ <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">bip32</span>::<span class="ident">KeySource</span><span class="op">></span>,
+ <span class="ident">derivation_path</span>: <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">descriptor_key</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">key</span>.<span class="ident">add_metadata</span>(<span class="ident">origin</span>, <span class="ident">derivation_path</span>)<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">descriptor_key</span>.<span class="ident">override_valid_networks</span>(<span class="self">self</span>.<span class="ident">valid_networks</span>))
+ }
+}
+
+<span class="comment">// Make generated keys directly usable in descriptors, and make sure they get assigned the right</span>
+<span class="comment">// `valid_networks`.</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>, <span class="ident">K</span><span class="op">></span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">GeneratedKey</span><span class="op"><</span><span class="ident">K</span>, <span class="ident">Ctx</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>,
+ <span class="ident">K</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>,
+{
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">desc_key</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">key</span>.<span class="ident">to_descriptor_key</span>()<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">desc_key</span>.<span class="ident">override_valid_networks</span>(<span class="self">self</span>.<span class="ident">valid_networks</span>))
+ }
+}
+
+<span class="doccomment">/// Trait for keys that can be generated</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// The same rules about [`ScriptContext`] and [`ValidNetworks`] from [`ToDescriptorKey`] apply.</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait is particularly useful when combined with [`DerivableKey`]: if `Self`</span>
+<span class="doccomment">/// implements it, the returned [`GeneratedKey`] will also implement it. The same is true for</span>
+<span class="doccomment">/// [`ToDescriptorKey`]: the generated keys can be directly used in descriptors if `Self` is also</span>
+<span class="doccomment">/// [`ToDescriptorKey`].</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>: <span class="ident">Sized</span> {
+ <span class="doccomment">/// Type specifying the amount of entropy required e.g. [u8;32]</span>
+ <span class="kw">type</span> <span class="ident">Entropy</span>: <span class="ident">AsMut</span><span class="op"><</span>[<span class="ident">u8</span>]<span class="op">></span> <span class="op">+</span> <span class="ident">Default</span>;
+
+ <span class="doccomment">/// Extra options required by the `generate_with_entropy`</span>
+ <span class="kw">type</span> <span class="ident">Options</span>;
+ <span class="doccomment">/// Returned error in case of failure</span>
+ <span class="kw">type</span> <span class="ident">Error</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span>;
+
+ <span class="doccomment">/// Generate a key given the extra options and the entropy</span>
+ <span class="kw">fn</span> <span class="ident">generate_with_entropy</span>(
+ <span class="ident">options</span>: <span class="self">Self</span>::<span class="ident">Options</span>,
+ <span class="ident">entropy</span>: <span class="self">Self</span>::<span class="ident">Entropy</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></span>;
+
+ <span class="doccomment">/// Generate a key given the options with a random entropy</span>
+ <span class="kw">fn</span> <span class="ident">generate</span>(<span class="ident">options</span>: <span class="self">Self</span>::<span class="ident">Options</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></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">let</span> <span class="kw-2">mut</span> <span class="ident">entropy</span> <span class="op">=</span> <span class="self">Self</span>::<span class="ident">Entropy</span>::<span class="ident">default</span>();
+ <span class="ident">thread_rng</span>().<span class="ident">fill</span>(<span class="ident">entropy</span>.<span class="ident">as_mut</span>());
+ <span class="self">Self</span>::<span class="ident">generate_with_entropy</span>(<span class="ident">options</span>, <span class="ident">entropy</span>)
+ }
+}
+
+<span class="doccomment">/// Trait that allows generating a key with the default options</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// This trait is automatically implemented if the [`GeneratableKey::Options`] implements [`Default`].</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">GeneratableDefaultOptions</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>: <span class="ident">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>,
+ <span class="op"><</span><span class="self">Self</span> <span class="kw">as</span> <span class="ident">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span><span class="op">></span>::<span class="ident">Options</span>: <span class="ident">Default</span>,
+{
+ <span class="doccomment">/// Generate a key with the default options and a given entropy</span>
+ <span class="kw">fn</span> <span class="ident">generate_with_entropy_default</span>(
+ <span class="ident">entropy</span>: <span class="self">Self</span>::<span class="ident">Entropy</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="self">Self</span>::<span class="ident">generate_with_entropy</span>(<span class="ident">Default</span>::<span class="ident">default</span>(), <span class="ident">entropy</span>)
+ }
+
+ <span class="doccomment">/// Generate a key with the default options and a random entropy</span>
+ <span class="kw">fn</span> <span class="ident">generate_default</span>() <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="self">Self</span>::<span class="ident">generate</span>(<span class="ident">Default</span>::<span class="ident">default</span>())
+ }
+}
+
+<span class="doccomment">/// Automatic implementation of [`GeneratableDefaultOptions`] for [`GeneratableKey`]s where</span>
+<span class="doccomment">/// `Options` implements `Default`</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>, <span class="ident">K</span><span class="op">></span> <span class="ident">GeneratableDefaultOptions</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">K</span>
+<span class="kw">where</span>
+ <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>,
+ <span class="ident">K</span>: <span class="ident">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>,
+ <span class="op"><</span><span class="ident">K</span> <span class="kw">as</span> <span class="ident">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span><span class="op">></span>::<span class="ident">Options</span>: <span class="ident">Default</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">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span> {
+ <span class="kw">type</span> <span class="ident">Entropy</span> <span class="op">=</span> [<span class="ident">u8</span>; <span class="number">32</span>];
+
+ <span class="kw">type</span> <span class="ident">Options</span> <span class="op">=</span> ();
+ <span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">Error</span>;
+
+ <span class="kw">fn</span> <span class="ident">generate_with_entropy</span>(
+ <span class="kw">_</span>: <span class="self">Self</span>::<span class="ident">Options</span>,
+ <span class="ident">entropy</span>: <span class="self">Self</span>::<span class="ident">Entropy</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// pick a arbitrary network here, but say that we support all of them</span>
+ <span class="kw">let</span> <span class="ident">xprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">new_master</span>(<span class="ident">Network</span>::<span class="ident">Bitcoin</span>, <span class="ident">entropy</span>.<span class="ident">as_ref</span>())<span class="question-mark">?</span>;
+ <span class="prelude-val">Ok</span>(<span class="ident">GeneratedKey</span>::<span class="ident">new</span>(<span class="ident">xprv</span>, <span class="ident">any_network</span>()))
+ }
+}
+
+<span class="doccomment">/// Options for generating a [`PrivateKey`]</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Defaults to creating compressed keys, which save on-chain bytes and fees</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>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">PrivateKeyGenerateOptions</span> {
+ <span class="doccomment">/// Whether the generated key should be "compressed" or not</span>
+ <span class="kw">pub</span> <span class="ident">compressed</span>: <span class="ident">bool</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">PrivateKeyGenerateOptions</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">PrivateKeyGenerateOptions</span> { <span class="ident">compressed</span>: <span class="bool-val">true</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">GeneratableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">PrivateKey</span> {
+ <span class="kw">type</span> <span class="ident">Entropy</span> <span class="op">=</span> [<span class="ident">u8</span>; <span class="ident">secp256k1</span>::<span class="ident">constants</span>::<span class="ident">SECRET_KEY_SIZE</span>];
+
+ <span class="kw">type</span> <span class="ident">Options</span> <span class="op">=</span> <span class="ident">PrivateKeyGenerateOptions</span>;
+ <span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">Error</span>;
+
+ <span class="kw">fn</span> <span class="ident">generate_with_entropy</span>(
+ <span class="ident">options</span>: <span class="self">Self</span>::<span class="ident">Options</span>,
+ <span class="ident">entropy</span>: <span class="self">Self</span>::<span class="ident">Entropy</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">GeneratedKey</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">Ctx</span><span class="op">></span>, <span class="self">Self</span>::<span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// pick a arbitrary network here, but say that we support all of them</span>
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">secp256k1</span>::<span class="ident">SecretKey</span>::<span class="ident">from_slice</span>(<span class="kw-2">&</span><span class="ident">entropy</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">private_key</span> <span class="op">=</span> <span class="ident">PrivateKey</span> {
+ <span class="ident">compressed</span>: <span class="ident">options</span>.<span class="ident">compressed</span>,
+ <span class="ident">network</span>: <span class="ident">Network</span>::<span class="ident">Bitcoin</span>,
+ <span class="ident">key</span>,
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">GeneratedKey</span>::<span class="ident">new</span>(<span class="ident">private_key</span>, <span class="ident">any_network</span>()))
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>, <span class="ident">T</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span><span class="op">></span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> (<span class="ident">T</span>, <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>) {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">add_metadata</span>(<span class="prelude-val">None</span>, <span class="self">self</span>.<span class="number">1</span>)
+ }
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span>, <span class="ident">T</span>: <span class="ident">DerivableKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span><span class="op">></span> <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>
+ <span class="kw">for</span> (<span class="ident">T</span>, <span class="ident">bip32</span>::<span class="ident">KeySource</span>, <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>)
+{
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="self">self</span>.<span class="number">0</span>.<span class="ident">add_metadata</span>(<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="number">1</span>), <span class="self">self</span>.<span class="number">2</span>)
+ }
+}
+
+<span class="kw">fn</span> <span class="ident">expand_multi_keys</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">pks</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">DescriptorPublicKey</span><span class="op">></span>, <span class="ident">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">pks</span>, <span class="ident">key_maps_networks</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">pks</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">key</span><span class="op">|</span> <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">KeyError</span><span class="op">></span>(<span class="ident">key</span>.<span class="ident">to_descriptor_key</span>()<span class="question-mark">?</span>.<span class="ident">extract</span>(<span class="ident">secp</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="kw">_</span><span class="op">></span><span class="op">></span>()<span class="question-mark">?</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">a</span>, <span class="ident">b</span>, <span class="ident">c</span>)<span class="op">|</span> (<span class="ident">a</span>, (<span class="ident">b</span>, <span class="ident">c</span>)))
+ .<span class="ident">unzip</span>();
+
+ <span class="kw">let</span> (<span class="ident">key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="ident">key_maps_networks</span>.<span class="ident">into_iter</span>().<span class="ident">fold</span>(
+ (<span class="ident">KeyMap</span>::<span class="ident">default</span>(), <span class="ident">any_network</span>()),
+ <span class="op">|</span>(<span class="kw-2">mut</span> <span class="ident">keys_acc</span>, <span class="ident">net_acc</span>), (<span class="ident">key</span>, <span class="ident">net</span>)<span class="op">|</span> {
+ <span class="ident">keys_acc</span>.<span class="ident">extend</span>(<span class="ident">key</span>.<span class="ident">into_iter</span>());
+ <span class="kw">let</span> <span class="ident">net_acc</span> <span class="op">=</span> <span class="ident">merge_networks</span>(<span class="kw-2">&</span><span class="ident">net_acc</span>, <span class="kw-2">&</span><span class="ident">net</span>);
+
+ (<span class="ident">keys_acc</span>, <span class="ident">net_acc</span>)
+ },
+ );
+
+ <span class="prelude-val">Ok</span>((<span class="ident">pks</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>))
+}
+
+<span class="comment">// Used internally by `bdk::fragment!` to build `pk_k()` fragments</span>
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_pk</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">descriptor_key</span>: <span class="ident">Pk</span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</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="ident">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">key</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="ident">descriptor_key</span>.<span class="ident">to_descriptor_key</span>()<span class="question-mark">?</span>.<span class="ident">extract</span>(<span class="ident">secp</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(<span class="ident">Terminal</span>::<span class="ident">PkK</span>(<span class="ident">key</span>))<span class="question-mark">?</span>,
+ <span class="ident">key_map</span>,
+ <span class="ident">valid_networks</span>,
+ ))
+}
+
+<span class="comment">// Used internally by `bdk::fragment!` to build `multi()` fragments</span>
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_multi</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">thresh</span>: <span class="ident">usize</span>,
+ <span class="ident">pks</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</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="ident">KeyMap</span>, <span class="ident">ValidNetworks</span>), <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">pks</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="ident">expand_multi_keys</span>(<span class="ident">pks</span>, <span class="ident">secp</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((
+ <span class="ident">Miniscript</span>::<span class="ident">from_ast</span>(<span class="ident">Terminal</span>::<span class="ident">Multi</span>(<span class="ident">thresh</span>, <span class="ident">pks</span>))<span class="question-mark">?</span>,
+ <span class="ident">key_map</span>,
+ <span class="ident">valid_networks</span>,
+ ))
+}
+
+<span class="comment">// Used internally by `bdk::descriptor!` to build `sortedmulti()` fragments</span>
+<span class="attribute">#[<span class="ident">doc</span>(<span class="ident">hidden</span>)]</span>
+<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_sortedmulti_inner</span><span class="op"><</span><span class="ident">Pk</span>: <span class="ident">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">thresh</span>: <span class="ident">usize</span>,
+ <span class="ident">pks</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Pk</span><span class="op">></span>,
+ <span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>,
+) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>
+ (
+ <span class="ident">SortedMultiVec</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span>, <span class="ident">Ctx</span><span class="op">></span>,
+ <span class="ident">KeyMap</span>,
+ <span class="ident">ValidNetworks</span>,
+ ),
+ <span class="ident">KeyError</span>,
+<span class="op">></span> {
+ <span class="kw">let</span> (<span class="ident">pks</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>) <span class="op">=</span> <span class="ident">expand_multi_keys</span>(<span class="ident">pks</span>, <span class="ident">secp</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>((<span class="ident">SortedMultiVec</span>::<span class="ident">new</span>(<span class="ident">thresh</span>, <span class="ident">pks</span>)<span class="question-mark">?</span>, <span class="ident">key_map</span>, <span class="ident">valid_networks</span>))
+}
+
+<span class="doccomment">/// The "identity" conversion is used internally by some `bdk::fragment`s</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="prelude-val">Ok</span>(<span class="self">self</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">DescriptorPublicKey</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">networks</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">SinglePub</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">any_network</span>(),
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">XPub</span>(<span class="ident">DescriptorXKey</span> { <span class="ident">xkey</span>, .. })
+ <span class="kw">if</span> <span class="ident">xkey</span>.<span class="ident">network</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span>
+ {
+ <span class="ident">mainnet_network</span>()
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">test_networks</span>(),
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DescriptorKey</span>::<span class="ident">from_public</span>(<span class="self">self</span>, <span class="ident">networks</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">PublicKey</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="ident">DescriptorPublicKey</span>::<span class="ident">SinglePub</span>(<span class="ident">DescriptorSinglePub</span> {
+ <span class="ident">key</span>: <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-val">None</span>,
+ })
+ .<span class="ident">to_descriptor_key</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">DescriptorSecretKey</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">networks</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="self">self</span> {
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">SinglePriv</span>(<span class="ident">sk</span>) <span class="kw">if</span> <span class="ident">sk</span>.<span class="ident">key</span>.<span class="ident">network</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">mainnet_network</span>()
+ }
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">XPrv</span>(<span class="ident">DescriptorXKey</span> { <span class="ident">xkey</span>, .. })
+ <span class="kw">if</span> <span class="ident">xkey</span>.<span class="ident">network</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Network</span>::<span class="ident">Bitcoin</span> <span class="op">=</span><span class="op">></span>
+ {
+ <span class="ident">mainnet_network</span>()
+ }
+ <span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="ident">test_networks</span>(),
+ };
+
+ <span class="prelude-val">Ok</span>(<span class="ident">DescriptorKey</span>::<span class="ident">from_secret</span>(<span class="self">self</span>, <span class="ident">networks</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">ToDescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span> <span class="kw">for</span> <span class="ident">PrivateKey</span> {
+ <span class="kw">fn</span> <span class="ident">to_descriptor_key</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">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">KeyError</span><span class="op">></span> {
+ <span class="ident">DescriptorSecretKey</span>::<span class="ident">SinglePriv</span>(<span class="ident">DescriptorSinglePriv</span> {
+ <span class="ident">key</span>: <span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-val">None</span>,
+ })
+ .<span class="ident">to_descriptor_key</span>()
+ }
+}
+
+<span class="doccomment">/// Errors thrown while working with [`keys`](crate::keys)</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">KeyError</span> {
+ <span class="doccomment">/// The key cannot exist in the given script context</span>
+ <span class="ident">InvalidScriptContext</span>,
+ <span class="doccomment">/// The key is not valid for the given network</span>
+ <span class="ident">InvalidNetwork</span>,
+ <span class="doccomment">/// The key has an invalid checksum</span>
+ <span class="ident">InvalidChecksum</span>,
+
+ <span class="doccomment">/// Custom error message</span>
+ <span class="ident">Message</span>(<span class="ident">String</span>),
+
+ <span class="doccomment">/// BIP32 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="doccomment">/// Miniscript error</span>
+ <span class="ident">Miniscript</span>(<span class="ident">miniscript</span>::<span class="ident">Error</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="ident">KeyError</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="ident">KeyError</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">KeyError</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">KeyError</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">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</span>;
+
+ <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">pub</span> <span class="kw">const</span> <span class="ident">TEST_ENTROPY</span>: [<span class="ident">u8</span>; <span class="number">32</span>] <span class="op">=</span> [<span class="number">0xAA</span>; <span class="number">32</span>];
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_generate_xprv</span>() {
+ <span class="kw">let</span> <span class="ident">generated_xprv</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">generate_with_entropy_default</span>(<span class="ident">TEST_ENTROPY</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_xprv</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</span>());
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_xprv</span>.<span class="ident">to_string</span>(), <span class="string">"xprv9s21ZrQH143K4Xr1cJyqTvuL2FWR8eicgY9boWqMBv8MDVUZ65AXHnzBrK1nyomu6wdcabRgmGTaAKawvhAno1V5FowGpTLVx3jxzE5uk3Q"</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_keys_generate_wif</span>() {
+ <span class="kw">let</span> <span class="ident">generated_wif</span>: <span class="ident">GeneratedKey</span><span class="op"><</span><span class="kw">_</span>, <span class="ident">miniscript</span>::<span class="ident">Segwitv0</span><span class="op">></span> <span class="op">=</span>
+ <span class="ident">bitcoin</span>::<span class="ident">PrivateKey</span>::<span class="ident">generate_with_entropy_default</span>(<span class="ident">TEST_ENTROPY</span>).<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">generated_wif</span>.<span class="ident">valid_networks</span>, <span class="ident">any_network</span>());
+ <span class="macro">assert_eq</span><span class="macro">!</span>(
+ <span class="ident">generated_wif</span>.<span class="ident">to_string</span>(),
+ <span class="string">"L2wTu6hQrnDMiFNWA5na6jB12ErGQqtXwqpSL7aWquJaZG8Ai3ch"</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 of the Rust file `src/lib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>lib.rs - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">// rustdoc will warn if there are missing docs</span>
+<span class="attribute">#![<span class="ident">warn</span>(<span class="ident">missing_docs</span>)]</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="doccomment">//! A modern, lightweight, descriptor-based wallet library written in Rust.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # About</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The BDK library aims to be the core building block for Bitcoin wallets of any kind.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! * It uses [Miniscript](https://github.com/rust-bitcoin/rust-miniscript) to support descriptors with generalized conditions. This exact same library can be used to build</span>
+<span class="doccomment">//! single-sig wallets, multisigs, timelocked contracts and more.</span>
+<span class="doccomment">//! * It supports multiple blockchain backends and databases, allowing developers to choose exactly what's right for their projects.</span>
+<span class="doccomment">//! * It is built to be cross-platform: the core logic works on desktop, mobile, and even WebAssembly.</span>
+<span class="doccomment">//! * It is very easy to extend: developers can implement customized logic for blockchain backends, databases, signers, coin selection, and more, without having to fork and modify this library.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! # A Tour of BDK</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! BDK consists of a number of modules that provide a range of functionality</span>
+<span class="doccomment">//! essential for implementing descriptor based Bitcoin wallet applications in Rust. In this</span>
+<span class="doccomment">//! section, we will take a brief tour of BDK, summarizing the major APIs and</span>
+<span class="doccomment">//! their uses.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! The easiest way to get started is to add bdk to your dependencies with the default features.</span>
+<span class="doccomment">//! The default features include a simple key-value database ([`sled`](sled)) to cache</span>
+<span class="doccomment">//! blockchain data and an [electrum](https://docs.rs/electrum-client/) blockchain client to</span>
+<span class="doccomment">//! interact with the bitcoin P2P network.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ```toml</span>
+<span class="doccomment">//! bdk = "0.2.0"</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Sync the balance of a descriptor</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Example</span>
+<span class="doccomment">//! ```ignore</span>
+<span class="doccomment">//! use bdk::Wallet;</span>
+<span class="doccomment">//! use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//! use bdk::blockchain::{noop_progress, ElectrumBlockchain};</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! use bdk::electrum_client::Client;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! fn main() -> Result<(), bdk::Error> {</span>
+<span class="doccomment">//! let client = Client::new("ssl://electrum.blockstream.info:60002")?;</span>
+<span class="doccomment">//! let wallet = Wallet::new(</span>
+<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",</span>
+<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),</span>
+<span class="doccomment">//! bitcoin::Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! ElectrumBlockchain::from(client)</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! wallet.sync(noop_progress(), None)?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! println!("Descriptor balance: {} SAT", wallet.get_balance()?);</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">//! ## Generate a few addresses</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Example</span>
+<span class="doccomment">//! ```</span>
+<span class="doccomment">//! use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">//! use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! fn main() -> Result<(), bdk::Error> {</span>
+<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",</span>
+<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),</span>
+<span class="doccomment">//! bitcoin::Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! println!("Address #0: {}", wallet.get_new_address()?);</span>
+<span class="doccomment">//! println!("Address #1: {}", wallet.get_new_address()?);</span>
+<span class="doccomment">//! println!("Address #2: {}", wallet.get_new_address()?);</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">//! ## Create a transaction</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Example</span>
+<span class="doccomment">//! ```ignore</span>
+<span class="doccomment">//! use base64::decode;</span>
+<span class="doccomment">//! use bdk::{FeeRate, TxBuilder, Wallet};</span>
+<span class="doccomment">//! use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//! use bdk::blockchain::{noop_progress, ElectrumBlockchain};</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! use bdk::electrum_client::Client;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! use bitcoin::consensus::serialize;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! fn main() -> Result<(), bdk::Error> {</span>
+<span class="doccomment">//! let client = Client::new("ssl://electrum.blockstream.info:60002")?;</span>
+<span class="doccomment">//! let wallet = Wallet::new(</span>
+<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",</span>
+<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),</span>
+<span class="doccomment">//! bitcoin::Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! ElectrumBlockchain::from(client)</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! wallet.sync(noop_progress(), None)?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let send_to = wallet.get_new_address()?;</span>
+<span class="doccomment">//! let (psbt, details) = wallet.create_tx(</span>
+<span class="doccomment">//! TxBuilder::with_recipients(vec![(send_to.script_pubkey(), 50_000)])</span>
+<span class="doccomment">//! .enable_rbf()</span>
+<span class="doccomment">//! .do_not_spend_change()</span>
+<span class="doccomment">//! .fee_rate(FeeRate::from_sat_per_vb(5.0))</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! println!("Transaction details: {:#?}", details);</span>
+<span class="doccomment">//! println!("Unsigned PSBT: {}", base64::encode(&serialize(&psbt)));</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">//! ## Sign a transaction</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ### Example</span>
+<span class="doccomment">//! ```ignore</span>
+<span class="doccomment">//! use base64::decode;</span>
+<span class="doccomment">//! use bdk::{Wallet, OfflineWallet};</span>
+<span class="doccomment">//! use bdk::database::MemoryDatabase;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! use bitcoin::consensus::deserialize;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! fn main() -> Result<(), bdk::Error> {</span>
+<span class="doccomment">//! let wallet: OfflineWallet<_> = Wallet::new_offline(</span>
+<span class="doccomment">//! "wpkh([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/0/*)",</span>
+<span class="doccomment">//! Some("wpkh([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/1/*)"),</span>
+<span class="doccomment">//! bitcoin::Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! )?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let psbt = "...";</span>
+<span class="doccomment">//! let psbt = deserialize(&base64::decode(psbt).unwrap())?;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! let (signed_psbt, finalized) = wallet.sign(psbt, None)?;</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">//! # Feature flags</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! BDK uses a set of [feature flags](https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section)</span>
+<span class="doccomment">//! to reduce the amount of compiled code by allowing projects to only enable the features they need.</span>
+<span class="doccomment">//! By default, BDK enables two internal features, `key-value-db` and `electrum`.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! If you are new to BDK we recommended that you use the default features which will enable</span>
+<span class="doccomment">//! basic descriptor wallet functionality. More advanced users can disable the `default` features</span>
+<span class="doccomment">//! (`--no-default-features`) and build the BDK library with only the features you need.</span>
+
+<span class="doccomment">//! Below is a list of the available feature flags and the additional functionality they provide.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! * `all-keys`: all features for working with bitcoin keys</span>
+<span class="doccomment">//! * `async-interface`: async functions in bdk traits</span>
+<span class="doccomment">//! * `cli-utils`: utilities for creating a command line interface wallet</span>
+<span class="doccomment">//! * `keys-bip39`: [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) mnemonic codes for generating deterministic keys</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! ## Internal features</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! These features do not expose any new API, but influence internal implementation aspects of</span>
+<span class="doccomment">//! BDK.</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! * `compact_filters`: [`compact_filters`](crate::blockchain::compact_filters) client protocol for interacting with the bitcoin P2P network</span>
+<span class="doccomment">//! * `electrum`: [`electrum`](crate::blockchain::electrum) client protocol for interacting with electrum servers</span>
+<span class="doccomment">//! * `esplora`: [`esplora`](crate::blockchain::esplora) client protocol for interacting with blockstream [electrs](https://github.com/Blockstream/electrs) servers</span>
+<span class="doccomment">//! * `key-value-db`: key value [`database`](crate::database) based on [`sled`](crate::sled) for caching blockchain data</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">feature</span> <span class="op">=</span> <span class="string">"keys-bip39"</span>)]</span>
+<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bip39</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">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">allow</span>(<span class="ident">unused_imports</span>)]</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">allow</span>(<span class="ident">unused_imports</span>)]</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">allow</span>(<span class="ident">unused_imports</span>)]</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">mod</span> <span class="ident">keys</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">template</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 of the Rust file `src/psbt/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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 of the Rust file `src/types.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>types.rs - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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 keychains</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">KeychainKind</span> {
+ <span class="doccomment">/// External</span>
+ <span class="ident">External</span> <span class="op">=</span> <span class="number">0</span>,
+ <span class="doccomment">/// Internal, usually used for change outputs</span>
+ <span class="ident">Internal</span> <span class="op">=</span> <span class="number">1</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">KeychainKind</span> {
+ <span class="doccomment">/// Return [`KeychainKind`] as a byte</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">KeychainKind</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">b'e'</span>,
+ <span class="ident">KeychainKind</span>::<span class="ident">Internal</span> <span class="op">=</span><span class="op">></span> <span class="string">b'i'</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">KeychainKind</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">KeychainKind</span>::<span class="ident">External</span> <span class="op">=</span><span class="op">></span> <span class="string">b"e"</span>,
+ <span class="ident">KeychainKind</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="doccomment">/// Reference to a transaction output</span>
+ <span class="kw">pub</span> <span class="ident">outpoint</span>: <span class="ident">OutPoint</span>,
+ <span class="doccomment">/// Transaction output</span>
+ <span class="kw">pub</span> <span class="ident">txout</span>: <span class="ident">TxOut</span>,
+ <span class="doccomment">/// Type of keychain</span>
+ <span class="kw">pub</span> <span class="ident">keychain</span>: <span class="ident">KeychainKind</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="doccomment">/// Optional transaction</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="doccomment">/// Transaction id</span>
+ <span class="kw">pub</span> <span class="ident">txid</span>: <span class="ident">Txid</span>,
+ <span class="doccomment">/// Timestamp</span>
+ <span class="kw">pub</span> <span class="ident">timestamp</span>: <span class="ident">u64</span>,
+ <span class="doccomment">/// Received value (sats)</span>
+ <span class="kw">pub</span> <span class="ident">received</span>: <span class="ident">u64</span>,
+ <span class="doccomment">/// Sent value (sats)</span>
+ <span class="kw">pub</span> <span class="ident">sent</span>: <span class="ident">u64</span>,
+ <span class="doccomment">/// Fee value (sats)</span>
+ <span class="kw">pub</span> <span class="ident">fees</span>: <span class="ident">u64</span>,
+ <span class="doccomment">/// Confirmed in block height, `None` means unconfirmed</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 of the Rust file `src/wallet/address_validator.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>address_validator.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! keychain: KeychainKind,</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 {:?}: {}", keychain, 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(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">KeychainKind</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="doccomment">/// User rejected the address</span>
+ <span class="ident">UserRejected</span>,
+ <span class="doccomment">/// Network connection error</span>
+ <span class="ident">ConnectionError</span>,
+ <span class="doccomment">/// Network request timeout error</span>
+ <span class="ident">TimeoutError</span>,
+ <span class="doccomment">/// Invalid script</span>
+ <span class="ident">InvalidScript</span>,
+ <span class="doccomment">/// A custom error message</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="ident">Send</span> <span class="op">+</span> <span class="ident">Sync</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">keychain</span>: <span class="ident">KeychainKind</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">_keychain</span>: <span class="ident">KeychainKind</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">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">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 of the Rust file `src/wallet/coin_selection.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>coin_selection.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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 bdk::wallet::coin_selection::*;</span>
+<span class="doccomment">//! # use bdk::database::Database;</span>
+<span class="doccomment">//! # use bdk::*;</span>
+<span class="doccomment">//! # const TXIN_BASE_WEIGHT: usize = (32 + 4 + 4 + 1) * 4;</span>
+<span class="doccomment">//! #[derive(Debug)]</span>
+<span class="doccomment">//! struct AlwaysSpendEverything;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! impl<D: Database> CoinSelectionAlgorithm<D> for AlwaysSpendEverything {</span>
+<span class="doccomment">//! fn coin_select(</span>
+<span class="doccomment">//! &self,</span>
+<span class="doccomment">//! database: &D,</span>
+<span class="doccomment">//! required_utxos: Vec<(UTXO, usize)>,</span>
+<span class="doccomment">//! optional_utxos: Vec<(UTXO, usize)>,</span>
+<span class="doccomment">//! fee_rate: FeeRate,</span>
+<span class="doccomment">//! amount_needed: u64,</span>
+<span class="doccomment">//! fee_amount: f32,</span>
+<span class="doccomment">//! ) -> Result<CoinSelectionResult, bdk::Error> {</span>
+<span class="doccomment">//! let mut selected_amount = 0;</span>
+<span class="doccomment">//! let mut additional_weight = 0;</span>
+<span class="doccomment">//! let all_utxos_selected = required_utxos</span>
+<span class="doccomment">//! .into_iter().chain(optional_utxos)</span>
+<span class="doccomment">//! .scan((&mut selected_amount, &mut additional_weight), |(selected_amount, additional_weight), (utxo, weight)| {</span>
+<span class="doccomment">//! **selected_amount += utxo.txout.value;</span>
+<span class="doccomment">//! **additional_weight += TXIN_BASE_WEIGHT + weight;</span>
+<span class="doccomment">//!</span>
+<span class="doccomment">//! Some(utxo)</span>
+<span class="doccomment">//! })</span>
+<span class="doccomment">//! .collect::<Vec<_>>();</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">//! selected: 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="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="ident">FeeRate</span>, <span class="ident">UTXO</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">not</span>(<span class="ident">test</span>))]</span>
+<span class="kw">use</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">use</span> <span class="ident">rand</span>::{<span class="ident">rngs</span>::<span class="ident">StdRng</span>, <span class="ident">SeedableRng</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="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">test</span>))]</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">DefaultCoinSelectionAlgorithm</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>;
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">DefaultCoinSelectionAlgorithm</span> <span class="op">=</span> <span class="ident">LargestFirstCoinSelection</span>; <span class="comment">// make the tests more predictable</span>
+
+<span class="comment">// Base weight of a Txin, not counting the weight needed for satisfying it.</span>
+<span class="comment">// prev_txid (32 bytes) + prev_vout (4 bytes) + sequence (4 bytes) + script_len (1 bytes)</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">TXIN_BASE_WEIGHT</span>: <span class="ident">usize</span> <span class="op">=</span> (<span class="number">32</span> <span class="op">+</span> <span class="number">4</span> <span class="op">+</span> <span class="number">4</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="number">4</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 outputs selected for use as inputs</span>
+ <span class="kw">pub</span> <span class="ident">selected</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</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="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></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">/// - `database`: a reference to the wallet's database that can be used to lookup additional</span>
+ <span class="doccomment">/// details for a specific UTXO</span>
+ <span class="doccomment">/// - `required_utxos`: the utxos that must be spent regardless of `amount_needed` with their</span>
+ <span class="doccomment">/// weight cost</span>
+ <span class="doccomment">/// - `optional_utxos`: the remaining available utxos to satisfy `amount_needed` with their</span>
+ <span class="doccomment">/// weight cost</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">/// - `fee_amount`: the amount of fees in satoshi already accumulated from adding outputs and</span>
+ <span class="doccomment">/// the transaction's header</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">database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>,
+ <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></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">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">LargestFirstCoinSelection</span>;
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span> <span class="kw">for</span> <span class="ident">LargestFirstCoinSelection</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">_database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>,
+ <span class="kw-2">mut</span> <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></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="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="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">"amount_needed = `{}`, fee_amount = `{}`, fee_rate = `{:?}`"</span>,
+ <span class="ident">amount_needed</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">fee_rate</span>
+ );
+
+ <span class="comment">// We put the "required UTXOs" first and make sure the optional UTXOs are sorted,</span>
+ <span class="comment">// initially smallest to largest, before being reversed with `.rev()`.</span>
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> {
+ <span class="ident">optional_utxos</span>.<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span>(<span class="ident">utxo</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span>);
+ <span class="ident">required_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="bool-val">true</span>, <span class="ident">utxo</span>))
+ .<span class="ident">chain</span>(<span class="ident">optional_utxos</span>.<span class="ident">into_iter</span>().<span class="ident">rev</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> (<span class="bool-val">false</span>, <span class="ident">utxo</span>)))
+ };
+
+ <span class="comment">// Keep including inputs until we've got enough.</span>
+ <span class="comment">// Store the total input value in selected_amount and the total fee being paid in fee_amount</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">selected_amount</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="kw">let</span> <span class="ident">selected</span> <span class="op">=</span> <span class="ident">utxos</span>
+ .<span class="ident">scan</span>(
+ (<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">selected_amount</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fee_amount</span>),
+ <span class="op">|</span>(<span class="ident">selected_amount</span>, <span class="ident">fee_amount</span>), (<span class="ident">must_use</span>, (<span class="ident">utxo</span>, <span class="ident">weight</span>))<span class="op">|</span> {
+ <span class="kw">if</span> <span class="ident">must_use</span> <span class="op">|</span><span class="op">|</span> <span class="kw-2">*</span><span class="kw-2">*</span><span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">amount_needed</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-2">*</span><span class="kw-2">*</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">TXIN_BASE_WEIGHT</span> <span class="op">+</span> <span class="ident">weight</span>);
+ <span class="kw-2">*</span><span class="kw-2">*</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="ident">log</span>::<span class="macro">debug</span><span class="macro">!</span>(
+ <span class="string">"Selected {}, updated fee_amount = `{}`"</span>,
+ <span class="ident">utxo</span>.<span class="ident">outpoint</span>,
+ <span class="ident">fee_amount</span>
+ );
+
+ <span class="prelude-val">Some</span>(<span class="ident">utxo</span>)
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</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">if</span> <span class="ident">selected_amount</span> <span class="op"><</span> <span class="ident">amount_needed</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">return</span> <span class="prelude-val">Err</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">selected</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">selected_amount</span>,
+ })
+ }
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
+<span class="comment">// Adds fee information to an UTXO.</span>
+<span class="kw">struct</span> <span class="ident">OutputGroup</span> {
+ <span class="ident">utxo</span>: <span class="ident">UTXO</span>,
+ <span class="comment">// weight needed to satisfy the UTXO, as described in `Descriptor::max_satisfaction_weight`</span>
+ <span class="ident">satisfaction_weight</span>: <span class="ident">usize</span>,
+ <span class="comment">// Amount of fees for spending a certain utxo, calculated using a certain FeeRate</span>
+ <span class="ident">fee</span>: <span class="ident">f32</span>,
+ <span class="comment">// The effective value of the UTXO, i.e., the utxo value minus the fee for spending it</span>
+ <span class="ident">effective_value</span>: <span class="ident">i64</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">OutputGroup</span> {
+ <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">utxo</span>: <span class="ident">UTXO</span>, <span class="ident">satisfaction_weight</span>: <span class="ident">usize</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="kw">let</span> <span class="ident">fee</span> <span class="op">=</span> (<span class="ident">TXIN_BASE_WEIGHT</span> <span class="op">+</span> <span class="ident">satisfaction_weight</span>) <span class="kw">as</span> <span class="ident">f32</span> <span class="op">/</span> <span class="number">4.0</span> <span class="op">*</span> <span class="ident">fee_rate</span>.<span class="ident">as_sat_vb</span>();
+ <span class="kw">let</span> <span class="ident">effective_value</span> <span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">txout</span>.<span class="ident">value</span> <span class="kw">as</span> <span class="ident">i64</span> <span class="op">-</span> <span class="ident">fee</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">i64</span>;
+ <span class="ident">OutputGroup</span> {
+ <span class="ident">utxo</span>,
+ <span class="ident">satisfaction_weight</span>,
+ <span class="ident">effective_value</span>,
+ <span class="ident">fee</span>,
+ }
+ }
+}
+
+<span class="doccomment">/// Branch and bound coin selection</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Code adapted from Bitcoin Core's implementation and from Mark Erhardt Master's Thesis: <http://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf></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">BranchAndBoundCoinSelection</span> {
+ <span class="ident">size_of_change</span>: <span class="ident">u64</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">BranchAndBoundCoinSelection</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="self">Self</span> {
+ <span class="comment">// P2WPKH cost of change -> value (8 bytes) + script len (1 bytes) + script (22 bytes)</span>
+ <span class="ident">size_of_change</span>: <span class="number">8</span> <span class="op">+</span> <span class="number">1</span> <span class="op">+</span> <span class="number">22</span>,
+ }
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BranchAndBoundCoinSelection</span> {
+ <span class="doccomment">/// Create new instance with target size for change output</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">size_of_change</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">size_of_change</span> }
+ }
+}
+
+<span class="kw">const</span> <span class="ident">BNB_TOTAL_TRIES</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">100_000</span>;
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span> <span class="kw">for</span> <span class="ident">BranchAndBoundCoinSelection</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">_database</span>: <span class="kw-2">&</span><span class="ident">D</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>,
+ <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></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">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="comment">// Mapping every (UTXO, usize) to an output group</span>
+ <span class="kw">let</span> <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span> <span class="op">=</span> <span class="ident">required_utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="comment">// Mapping every (UTXO, usize) to an output group.</span>
+ <span class="comment">// Filtering UTXOs with an effective_value < 0, as the fee paid for</span>
+ <span class="comment">// adding them is more than their value</span>
+ <span class="kw">let</span> <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span> <span class="op">=</span> <span class="ident">optional_utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">u</span>.<span class="ident">effective_value</span> <span class="op">></span> <span class="number">0</span>)
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">curr_value</span> <span class="op">=</span> <span class="ident">required_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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="kw">let</span> <span class="ident">curr_available_value</span> <span class="op">=</span> <span class="ident">optional_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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="kw">let</span> <span class="ident">actual_target</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="ident">amount_needed</span>;
+ <span class="kw">let</span> <span class="ident">cost_of_change</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">size_of_change</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="kw">if</span> <span class="ident">curr_available_value</span> <span class="op">+</span> <span class="ident">curr_value</span> <span class="op"><</span> <span class="ident">actual_target</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">Ok</span>(<span class="self">self</span>
+ .<span class="ident">bnb</span>(
+ <span class="ident">required_utxos</span>.<span class="ident">clone</span>(),
+ <span class="ident">optional_utxos</span>.<span class="ident">clone</span>(),
+ <span class="ident">curr_value</span>,
+ <span class="ident">curr_available_value</span>,
+ <span class="ident">actual_target</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">cost_of_change</span>,
+ )
+ .<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> {
+ <span class="self">self</span>.<span class="ident">single_random_draw</span>(
+ <span class="ident">required_utxos</span>,
+ <span class="ident">optional_utxos</span>,
+ <span class="ident">curr_value</span>,
+ <span class="ident">actual_target</span>,
+ <span class="ident">fee_amount</span>,
+ )
+ }))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">BranchAndBoundCoinSelection</span> {
+ <span class="comment">// TODO: make this more Rust-onic :)</span>
+ <span class="comment">// (And perhpaps refactor with less arguments?)</span>
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">clippy</span>::<span class="ident">too_many_arguments</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">bnb</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span>,
+ <span class="kw-2">mut</span> <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span>,
+ <span class="kw-2">mut</span> <span class="ident">curr_value</span>: <span class="ident">u64</span>,
+ <span class="kw-2">mut</span> <span class="ident">curr_available_value</span>: <span class="ident">u64</span>,
+ <span class="ident">actual_target</span>: <span class="ident">u64</span>,
+ <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+ <span class="ident">cost_of_change</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="comment">// current_selection[i] will contain true if we are using optional_utxos[i],</span>
+ <span class="comment">// false otherwise. Note that current_selection.len() could be less than</span>
+ <span class="comment">// optional_utxos.len(), it just means that we still haven't decided if we should keep</span>
+ <span class="comment">// certain optional_utxos or not.</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">current_selection</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">bool</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="ident">optional_utxos</span>.<span class="ident">len</span>());
+
+ <span class="comment">// Sort the utxo_pool</span>
+ <span class="ident">optional_utxos</span>.<span class="ident">sort_unstable_by_key</span>(<span class="op">|</span><span class="ident">a</span><span class="op">|</span> <span class="ident">a</span>.<span class="ident">effective_value</span>);
+ <span class="ident">optional_utxos</span>.<span class="ident">reverse</span>();
+
+ <span class="comment">// Contains the best selection we found</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">best_selection</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">best_selection_value</span> <span class="op">=</span> <span class="prelude-val">None</span>;
+
+ <span class="comment">// Depth First search loop for choosing the UTXOs</span>
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">BNB_TOTAL_TRIES</span> {
+ <span class="comment">// Conditions for starting a backtrack</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">backtrack</span> <span class="op">=</span> <span class="bool-val">false</span>;
+ <span class="comment">// Cannot possibly reach target with the amount remaining in the curr_available_value,</span>
+ <span class="comment">// or the selected value is out of range.</span>
+ <span class="comment">// Go back and try other branch</span>
+ <span class="kw">if</span> <span class="ident">curr_value</span> <span class="op">+</span> <span class="ident">curr_available_value</span> <span class="op"><</span> <span class="ident">actual_target</span>
+ <span class="op">|</span><span class="op">|</span> <span class="ident">curr_value</span> <span class="op">></span> <span class="ident">actual_target</span> <span class="op">+</span> <span class="ident">cost_of_change</span> <span class="kw">as</span> <span class="ident">u64</span>
+ {
+ <span class="ident">backtrack</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">curr_value</span> <span class="op">></span><span class="op">=</span> <span class="ident">actual_target</span> {
+ <span class="comment">// Selected value is within range, there's no point in going forward. Start</span>
+ <span class="comment">// backtracking</span>
+ <span class="ident">backtrack</span> <span class="op">=</span> <span class="bool-val">true</span>;
+
+ <span class="comment">// If we found a solution better than the previous one, or if there wasn't previous</span>
+ <span class="comment">// solution, update the best solution</span>
+ <span class="kw">if</span> <span class="ident">best_selection_value</span>.<span class="ident">is_none</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">curr_value</span> <span class="op"><</span> <span class="ident">best_selection_value</span>.<span class="ident">unwrap</span>() {
+ <span class="ident">best_selection</span> <span class="op">=</span> <span class="ident">current_selection</span>.<span class="ident">clone</span>();
+ <span class="ident">best_selection_value</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">curr_value</span>);
+ }
+
+ <span class="comment">// If we found a perfect match, break here</span>
+ <span class="kw">if</span> <span class="ident">curr_value</span> <span class="op">=</span><span class="op">=</span> <span class="ident">actual_target</span> {
+ <span class="kw">break</span>;
+ }
+ }
+
+ <span class="comment">// Backtracking, moving backwards</span>
+ <span class="kw">if</span> <span class="ident">backtrack</span> {
+ <span class="comment">// Walk backwards to find the last included UTXO that still needs to have its omission branch traversed.</span>
+ <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="bool-val">false</span>) <span class="op">=</span> <span class="ident">current_selection</span>.<span class="ident">last</span>() {
+ <span class="ident">current_selection</span>.<span class="ident">pop</span>();
+ <span class="ident">curr_available_value</span> <span class="op">+</span><span class="op">=</span>
+ <span class="ident">optional_utxos</span>[<span class="ident">current_selection</span>.<span class="ident">len</span>()].<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+ }
+
+ <span class="kw">if</span> <span class="ident">current_selection</span>.<span class="ident">last_mut</span>().<span class="ident">is_none</span>() {
+ <span class="comment">// We have walked back to the first utxo and no branch is untraversed. All solutions searched</span>
+ <span class="comment">// If best selection is empty, then there's no exact match</span>
+ <span class="kw">if</span> <span class="ident">best_selection</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">BnBNoExactMatch</span>);
+ }
+ <span class="kw">break</span>;
+ }
+
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">c</span>) <span class="op">=</span> <span class="ident">current_selection</span>.<span class="ident">last_mut</span>() {
+ <span class="comment">// Output was included on previous iterations, try excluding now.</span>
+ <span class="kw-2">*</span><span class="ident">c</span> <span class="op">=</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">optional_utxos</span>[<span class="ident">current_selection</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>];
+ <span class="ident">curr_value</span> <span class="op">-</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+ } <span class="kw">else</span> {
+ <span class="comment">// Moving forwards, continuing down this branch</span>
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">optional_utxos</span>[<span class="ident">current_selection</span>.<span class="ident">len</span>()];
+
+ <span class="comment">// Remove this utxo from the curr_available_value utxo amount</span>
+ <span class="ident">curr_available_value</span> <span class="op">-</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+
+ <span class="comment">// Inclusion branch first (Largest First Exploration)</span>
+ <span class="ident">current_selection</span>.<span class="ident">push</span>(<span class="bool-val">true</span>);
+ <span class="ident">curr_value</span> <span class="op">+</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+ }
+ }
+
+ <span class="comment">// Check for solution</span>
+ <span class="kw">if</span> <span class="ident">best_selection</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">BnBTotalTriesExceeded</span>);
+ }
+
+ <span class="comment">// Set output set</span>
+ <span class="kw">let</span> <span class="ident">selected_utxos</span> <span class="op">=</span> <span class="ident">optional_utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">zip</span>(<span class="ident">best_selection</span>)
+ .<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">optional</span>, <span class="ident">is_in_best</span>)<span class="op">|</span> <span class="kw">if</span> <span class="ident">is_in_best</span> { <span class="prelude-val">Some</span>(<span class="ident">optional</span>) } <span class="kw">else</span> { <span class="prelude-val">None</span> })
+ .<span class="ident">collect</span>();
+
+ <span class="prelude-val">Ok</span>(<span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">calculate_cs_result</span>(
+ <span class="ident">selected_utxos</span>,
+ <span class="ident">required_utxos</span>,
+ <span class="ident">fee_amount</span>,
+ ))
+ }
+
+ <span class="kw">fn</span> <span class="ident">single_random_draw</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span>,
+ <span class="kw-2">mut</span> <span class="ident">optional_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span>,
+ <span class="ident">curr_value</span>: <span class="ident">u64</span>,
+ <span class="ident">actual_target</span>: <span class="ident">u64</span>,
+ <span class="ident">fee_amount</span>: <span class="ident">f32</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="ident">CoinSelectionResult</span> {
+ <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">not</span>(<span class="ident">test</span>))]</span>
+ <span class="ident">optional_utxos</span>.<span class="ident">shuffle</span>(<span class="kw-2">&</span><span class="kw-2">mut</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="ident">seed</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">32</span>];
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span>: <span class="ident">StdRng</span> <span class="op">=</span> <span class="ident">SeedableRng</span>::<span class="ident">from_seed</span>(<span class="ident">seed</span>);
+ <span class="ident">optional_utxos</span>.<span class="ident">shuffle</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">selected_utxos</span> <span class="op">=</span> <span class="ident">optional_utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">scan</span>(<span class="ident">curr_value</span>, <span class="op">|</span><span class="ident">curr_value</span>, <span class="ident">utxo</span><span class="op">|</span> {
+ <span class="kw">if</span> <span class="kw-2">*</span><span class="ident">curr_value</span> <span class="op">></span><span class="op">=</span> <span class="ident">actual_target</span> {
+ <span class="prelude-val">None</span>
+ } <span class="kw">else</span> {
+ <span class="kw-2">*</span><span class="ident">curr_value</span> <span class="op">+</span><span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+ <span class="prelude-val">Some</span>(<span class="ident">utxo</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">BranchAndBoundCoinSelection</span>::<span class="ident">calculate_cs_result</span>(<span class="ident">selected_utxos</span>, <span class="ident">required_utxos</span>, <span class="ident">fee_amount</span>)
+ }
+
+ <span class="kw">fn</span> <span class="ident">calculate_cs_result</span>(
+ <span class="kw-2">mut</span> <span class="ident">selected_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span>,
+ <span class="kw-2">mut</span> <span class="ident">required_utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></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="ident">CoinSelectionResult</span> {
+ <span class="ident">selected_utxos</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">required_utxos</span>);
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">selected_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="ident">u</span>.<span class="ident">fee</span>).<span class="ident">sum</span>::<span class="op"><</span><span class="ident">f32</span><span class="op">></span>();
+ <span class="kw">let</span> <span class="ident">selected</span> <span class="op">=</span> <span class="ident">selected_utxos</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">u</span>.<span class="ident">utxo</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">selected_amount</span> <span class="op">=</span> <span class="ident">selected</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="ident">u</span>.<span class="ident">txout</span>.<span class="ident">value</span>).<span class="ident">sum</span>();
+
+ <span class="ident">CoinSelectionResult</span> {
+ <span class="ident">selected</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">database</span>::<span class="ident">MemoryDatabase</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="kw-2">*</span>;
+
+ <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">rngs</span>::<span class="ident">StdRng</span>;
+ <span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">seq</span>::<span class="ident">SliceRandom</span>;
+ <span class="kw">use</span> <span class="ident">rand</span>::{<span class="ident">Rng</span>, <span class="ident">SeedableRng</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="ident">usize</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</span>,
+ },
+ <span class="ident">P2WPKH_WITNESS_SIZE</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>,
+ },
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ ),
+ ]
+ }
+
+ <span class="kw">fn</span> <span class="ident">generate_random_utxos</span>(<span class="ident">rng</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">StdRng</span>, <span class="ident">utxos_number</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">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">res</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="ident">utxos_number</span> {
+ <span class="ident">res</span>.<span class="ident">push</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="ident">rng</span>.<span class="ident">gen_range</span>(<span class="number">0</span>, <span class="number">200000000</span>),
+ <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
+ },
+ <span class="ident">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</span>,
+ },
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ ));
+ }
+ <span class="ident">res</span>
+ }
+
+ <span class="kw">fn</span> <span class="ident">generate_same_value_utxos</span>(<span class="ident">utxos_value</span>: <span class="ident">u64</span>, <span class="ident">utxos_number</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">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</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="ident">utxos_value</span>,
+ <span class="ident">script_pubkey</span>: <span class="ident">Script</span>::<span class="ident">new</span>(),
+ },
+ <span class="ident">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</span>,
+ },
+ <span class="ident">P2WPKH_WITNESS_SIZE</span>,
+ );
+ <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">utxo</span>; <span class="ident">utxos_number</span>]
+ }
+
+ <span class="kw">fn</span> <span class="ident">sum_random_utxos</span>(<span class="kw-2">mut</span> <span class="ident">rng</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">StdRng</span>, <span class="ident">utxos</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
+ <span class="kw">let</span> <span class="ident">utxos_picked_len</span> <span class="op">=</span> <span class="ident">rng</span>.<span class="ident">gen_range</span>(<span class="number">2</span>, <span class="ident">utxos</span>.<span class="ident">len</span>() <span class="op">/</span> <span class="number">2</span>);
+ <span class="ident">utxos</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">utxos</span>[..<span class="ident">utxos_picked_len</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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="number">0</span>.<span class="ident">txout</span>.<span class="ident">value</span>)
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_largest_first_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">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">LargestFirstCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="ident">utxos</span>,
+ <span class="macro">vec</span><span class="macro">!</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="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">selected</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_largest_first_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">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">LargestFirstCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="ident">utxos</span>,
+ <span class="macro">vec</span><span class="macro">!</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="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">selected</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_largest_first_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">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">LargestFirstCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="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">selected</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_largest_first_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="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="ident">LargestFirstCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="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_largest_first_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="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="ident">LargestFirstCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="number">50.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_bnb_coin_selection_success</span>() {
+ <span class="comment">// In this case bnb won't find a suitable match and single random draw will</span>
+ <span class="comment">// select three outputs</span>
+ <span class="kw">let</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">generate_same_value_utxos</span>(<span class="number">100_000</span>, <span class="number">20</span>);
+
+ <span class="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="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">selected</span>.<span class="ident">len</span>(), <span class="number">3</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">254.0</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_coin_selection_required_are_enough</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">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="ident">utxos</span>.<span class="ident">clone</span>(),
+ <span class="ident">utxos</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="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">selected</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="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_bnb_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="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="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_bnb_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="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">default</span>()
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</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="number">50.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_bnb_coin_selection_check_fee_rate</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">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="number">0</span>)
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</span>.<span class="ident">clone</span>(),
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">1.0</span>),
+ <span class="number">99932</span>, <span class="comment">// first utxo's effective value</span>
+ <span class="number">0.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">selected</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">100_000</span>);
+ <span class="kw">let</span> <span class="ident">input_size</span> <span class="op">=</span> (<span class="ident">TXIN_BASE_WEIGHT</span> <span class="kw">as</span> <span class="ident">f32</span>) <span class="op">/</span> <span class="number">4.0</span> <span class="op">+</span> <span class="ident">P2WPKH_WITNESS_SIZE</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">epsilon</span> <span class="op">=</span> <span class="number">0.5</span>;
+ <span class="macro">assert</span><span class="macro">!</span>((<span class="number">1.0</span> <span class="op">-</span> (<span class="ident">result</span>.<span class="ident">fee_amount</span> <span class="op">/</span> <span class="ident">input_size</span>)).<span class="ident">abs</span>() <span class="op"><</span> <span class="ident">epsilon</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_coin_selection_exact_match</span>() {
+ <span class="kw">let</span> <span class="ident">seed</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">32</span>];
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span>: <span class="ident">StdRng</span> <span class="op">=</span> <span class="ident">SeedableRng</span>::<span class="ident">from_seed</span>(<span class="ident">seed</span>);
+ <span class="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="ident">MemoryDatabase</span>::<span class="ident">default</span>();
+
+ <span class="kw">for</span> <span class="ident">_i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">200</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">optional_utxos</span> <span class="op">=</span> <span class="ident">generate_random_utxos</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>, <span class="number">16</span>);
+ <span class="kw">let</span> <span class="ident">target_amount</span> <span class="op">=</span> <span class="ident">sum_random_utxos</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">optional_utxos</span>);
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="number">0</span>)
+ .<span class="ident">coin_select</span>(
+ <span class="kw-2">&</span><span class="ident">database</span>,
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">optional_utxos</span>,
+ <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">0.0</span>),
+ <span class="ident">target_amount</span>,
+ <span class="number">0.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">selected_amount</span>, <span class="ident">target_amount</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">"BnBNoExactMatch"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_function_no_exact_match</span>() {
+ <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">10.0</span>);
+ <span class="kw">let</span> <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span> <span class="op">=</span> <span class="ident">get_test_utxos</span>()
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">curr_available_value</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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="kw">let</span> <span class="ident">size_of_change</span> <span class="op">=</span> <span class="number">31</span>;
+ <span class="kw">let</span> <span class="ident">cost_of_change</span> <span class="op">=</span> <span class="ident">size_of_change</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="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="ident">size_of_change</span>)
+ .<span class="ident">bnb</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</span>,
+ <span class="number">0</span>,
+ <span class="ident">curr_available_value</span>,
+ <span class="number">20_000</span>,
+ <span class="number">50.0</span>,
+ <span class="ident">cost_of_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">"BnBTotalTriesExceeded"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_function_tries_exceeded</span>() {
+ <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">10.0</span>);
+ <span class="kw">let</span> <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></span> <span class="op">=</span> <span class="ident">generate_same_value_utxos</span>(<span class="number">100_000</span>, <span class="number">100_000</span>)
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">curr_available_value</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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="kw">let</span> <span class="ident">size_of_change</span> <span class="op">=</span> <span class="number">31</span>;
+ <span class="kw">let</span> <span class="ident">cost_of_change</span> <span class="op">=</span> <span class="ident">size_of_change</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="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="ident">size_of_change</span>)
+ .<span class="ident">bnb</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</span>,
+ <span class="number">0</span>,
+ <span class="ident">curr_available_value</span>,
+ <span class="number">20_000</span>,
+ <span class="number">50.0</span>,
+ <span class="ident">cost_of_change</span>,
+ )
+ .<span class="ident">unwrap</span>();
+ }
+
+ <span class="comment">// The match won't be exact but still in the range</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_function_almost_exact_match_with_fees</span>() {
+ <span class="kw">let</span> <span class="ident">fee_rate</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="kw">let</span> <span class="ident">size_of_change</span> <span class="op">=</span> <span class="number">31</span>;
+ <span class="kw">let</span> <span class="ident">cost_of_change</span> <span class="op">=</span> <span class="ident">size_of_change</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="kw">let</span> <span class="ident">fee_amount</span> <span class="op">=</span> <span class="number">50.0</span>;
+
+ <span class="kw">let</span> <span class="ident">utxos</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">generate_same_value_utxos</span>(<span class="number">50_000</span>, <span class="number">10</span>)
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">curr_value</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">let</span> <span class="ident">curr_available_value</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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="comment">// 2*(value of 1 utxo) - 2*(1 utxo fees with 1.0sat/vbyte fee rate) -</span>
+ <span class="comment">// cost_of_change + 5.</span>
+ <span class="kw">let</span> <span class="ident">target_amount</span> <span class="op">=</span> <span class="number">2</span> <span class="op">*</span> <span class="number">50_000</span> <span class="op">-</span> <span class="number">2</span> <span class="op">*</span> <span class="number">67</span> <span class="op">-</span> <span class="ident">cost_of_change</span>.<span class="ident">ceil</span>() <span class="kw">as</span> <span class="ident">u64</span> <span class="op">+</span> <span class="number">5</span>;
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="ident">size_of_change</span>)
+ .<span class="ident">bnb</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</span>,
+ <span class="ident">curr_value</span>,
+ <span class="ident">curr_available_value</span>,
+ <span class="ident">target_amount</span>,
+ <span class="ident">fee_amount</span>,
+ <span class="ident">cost_of_change</span>,
+ )
+ .<span class="ident">unwrap</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="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span>, <span class="number">100_000</span>);
+ }
+
+ <span class="comment">// TODO: bnb() function should be optimized, and this test should be done with more utxos</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bnb_function_exact_match_more_utxos</span>() {
+ <span class="kw">let</span> <span class="ident">seed</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">32</span>];
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span>: <span class="ident">StdRng</span> <span class="op">=</span> <span class="ident">SeedableRng</span>::<span class="ident">from_seed</span>(<span class="ident">seed</span>);
+ <span class="kw">let</span> <span class="ident">fee_rate</span> <span class="op">=</span> <span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">0.0</span>);
+
+ <span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">200</span> {
+ <span class="kw">let</span> <span class="ident">optional_utxos</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">generate_random_utxos</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>, <span class="number">40</span>)
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">curr_value</span> <span class="op">=</span> <span class="number">0</span>;
+
+ <span class="kw">let</span> <span class="ident">curr_available_value</span> <span class="op">=</span> <span class="ident">optional_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">x</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>.<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>);
+
+ <span class="kw">let</span> <span class="ident">target_amount</span> <span class="op">=</span> <span class="ident">optional_utxos</span>[<span class="number">3</span>].<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>
+ <span class="op">+</span> <span class="ident">optional_utxos</span>[<span class="number">23</span>].<span class="ident">effective_value</span> <span class="kw">as</span> <span class="ident">u64</span>;
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">new</span>(<span class="number">0</span>)
+ .<span class="ident">bnb</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">optional_utxos</span>,
+ <span class="ident">curr_value</span>,
+ <span class="ident">curr_available_value</span>,
+ <span class="ident">target_amount</span>,
+ <span class="number">0.0</span>,
+ <span class="number">0.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">selected_amount</span>, <span class="ident">target_amount</span>);
+ }
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_single_random_draw_function_success</span>() {
+ <span class="kw">let</span> <span class="ident">seed</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">32</span>];
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span>: <span class="ident">StdRng</span> <span class="op">=</span> <span class="ident">SeedableRng</span>::<span class="ident">from_seed</span>(<span class="ident">seed</span>);
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">utxos</span> <span class="op">=</span> <span class="ident">generate_random_utxos</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>, <span class="number">300</span>);
+ <span class="kw">let</span> <span class="ident">target_amount</span> <span class="op">=</span> <span class="ident">sum_random_utxos</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rng</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">utxos</span>);
+
+ <span class="kw">let</span> <span class="ident">fee_rate</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="kw">let</span> <span class="ident">utxos</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">OutputGroup</span><span class="op">></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">u</span><span class="op">|</span> <span class="ident">OutputGroup</span>::<span class="ident">new</span>(<span class="ident">u</span>.<span class="number">0</span>, <span class="ident">u</span>.<span class="number">1</span>, <span class="ident">fee_rate</span>))
+ .<span class="ident">collect</span>();
+
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">BranchAndBoundCoinSelection</span>::<span class="ident">default</span>().<span class="ident">single_random_draw</span>(
+ <span class="macro">vec</span><span class="macro">!</span>[],
+ <span class="ident">utxos</span>,
+ <span class="number">0</span>,
+ <span class="ident">target_amount</span>,
+ <span class="number">50.0</span>,
+ );
+
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">selected_amount</span> <span class="op">></span> <span class="ident">target_amount</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">50.0</span> <span class="op">+</span> <span class="ident">result</span>.<span class="ident">selected</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">f32</span> <span class="op">*</span> <span class="number">68.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 of the Rust file `src/wallet/export.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>export.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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(</span>
+<span class="doccomment">//! &import.descriptor(),</span>
+<span class="doccomment">//! import.change_descriptor().as_ref(),</span>
+<span class="doccomment">//! Network::Testnet,</span>
+<span class="doccomment">//! MemoryDatabase::default(),</span>
+<span class="doccomment">//! )?;</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">DescriptorPublicKey</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="ident">wallet</span>.<span class="ident">secp_ctx</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_unstable</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">let</span> <span class="ident">desc_to_string</span> <span class="op">=</span> <span class="op">|</span><span class="ident">d</span>: <span class="kw-2">&</span><span class="ident">Descriptor</span><span class="op"><</span><span class="ident">DescriptorPublicKey</span><span class="op">></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="ident">wallet</span>.<span class="ident">secp_ctx</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="ident">desc_to_string</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">Bitcoin</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">Bitcoin</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">Bitcoin</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">Bitcoin</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 of the Rust file `src/wallet/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+<span id="2440">2440</span>
+<span id="2441">2441</span>
+<span id="2442">2442</span>
+<span id="2443">2443</span>
+<span id="2444">2444</span>
+<span id="2445">2445</span>
+<span id="2446">2446</span>
+<span id="2447">2447</span>
+<span id="2448">2448</span>
+<span id="2449">2449</span>
+<span id="2450">2450</span>
+<span id="2451">2451</span>
+<span id="2452">2452</span>
+<span id="2453">2453</span>
+<span id="2454">2454</span>
+<span id="2455">2455</span>
+<span id="2456">2456</span>
+<span id="2457">2457</span>
+<span id="2458">2458</span>
+<span id="2459">2459</span>
+<span id="2460">2460</span>
+<span id="2461">2461</span>
+<span id="2462">2462</span>
+<span id="2463">2463</span>
+<span id="2464">2464</span>
+<span id="2465">2465</span>
+<span id="2466">2466</span>
+<span id="2467">2467</span>
+<span id="2468">2468</span>
+<span id="2469">2469</span>
+<span id="2470">2470</span>
+<span id="2471">2471</span>
+<span id="2472">2472</span>
+<span id="2473">2473</span>
+<span id="2474">2474</span>
+<span id="2475">2475</span>
+<span id="2476">2476</span>
+<span id="2477">2477</span>
+<span id="2478">2478</span>
+<span id="2479">2479</span>
+<span id="2480">2480</span>
+<span id="2481">2481</span>
+<span id="2482">2482</span>
+<span id="2483">2483</span>
+<span id="2484">2484</span>
+<span id="2485">2485</span>
+<span id="2486">2486</span>
+<span id="2487">2487</span>
+<span id="2488">2488</span>
+<span id="2489">2489</span>
+<span id="2490">2490</span>
+<span id="2491">2491</span>
+<span id="2492">2492</span>
+<span id="2493">2493</span>
+<span id="2494">2494</span>
+<span id="2495">2495</span>
+<span id="2496">2496</span>
+<span id="2497">2497</span>
+<span id="2498">2498</span>
+<span id="2499">2499</span>
+<span id="2500">2500</span>
+<span id="2501">2501</span>
+<span id="2502">2502</span>
+<span id="2503">2503</span>
+<span id="2504">2504</span>
+<span id="2505">2505</span>
+<span id="2506">2506</span>
+<span id="2507">2507</span>
+<span id="2508">2508</span>
+<span id="2509">2509</span>
+<span id="2510">2510</span>
+<span id="2511">2511</span>
+<span id="2512">2512</span>
+<span id="2513">2513</span>
+<span id="2514">2514</span>
+<span id="2515">2515</span>
+<span id="2516">2516</span>
+<span id="2517">2517</span>
+<span id="2518">2518</span>
+<span id="2519">2519</span>
+<span id="2520">2520</span>
+<span id="2521">2521</span>
+<span id="2522">2522</span>
+<span id="2523">2523</span>
+<span id="2524">2524</span>
+<span id="2525">2525</span>
+<span id="2526">2526</span>
+<span id="2527">2527</span>
+<span id="2528">2528</span>
+<span id="2529">2529</span>
+<span id="2530">2530</span>
+<span id="2531">2531</span>
+<span id="2532">2532</span>
+<span id="2533">2533</span>
+<span id="2534">2534</span>
+<span id="2535">2535</span>
+<span id="2536">2536</span>
+<span id="2537">2537</span>
+<span id="2538">2538</span>
+<span id="2539">2539</span>
+<span id="2540">2540</span>
+<span id="2541">2541</span>
+<span id="2542">2542</span>
+<span id="2543">2543</span>
+<span id="2544">2544</span>
+<span id="2545">2545</span>
+<span id="2546">2546</span>
+<span id="2547">2547</span>
+<span id="2548">2548</span>
+<span id="2549">2549</span>
+<span id="2550">2550</span>
+<span id="2551">2551</span>
+<span id="2552">2552</span>
+<span id="2553">2553</span>
+<span id="2554">2554</span>
+<span id="2555">2555</span>
+<span id="2556">2556</span>
+<span id="2557">2557</span>
+<span id="2558">2558</span>
+<span id="2559">2559</span>
+<span id="2560">2560</span>
+<span id="2561">2561</span>
+<span id="2562">2562</span>
+<span id="2563">2563</span>
+<span id="2564">2564</span>
+<span id="2565">2565</span>
+<span id="2566">2566</span>
+<span id="2567">2567</span>
+<span id="2568">2568</span>
+<span id="2569">2569</span>
+<span id="2570">2570</span>
+<span id="2571">2571</span>
+<span id="2572">2572</span>
+<span id="2573">2573</span>
+<span id="2574">2574</span>
+<span id="2575">2575</span>
+<span id="2576">2576</span>
+<span id="2577">2577</span>
+<span id="2578">2578</span>
+<span id="2579">2579</span>
+<span id="2580">2580</span>
+<span id="2581">2581</span>
+<span id="2582">2582</span>
+<span id="2583">2583</span>
+<span id="2584">2584</span>
+<span id="2585">2585</span>
+<span id="2586">2586</span>
+<span id="2587">2587</span>
+<span id="2588">2588</span>
+<span id="2589">2589</span>
+<span id="2590">2590</span>
+<span id="2591">2591</span>
+<span id="2592">2592</span>
+<span id="2593">2593</span>
+<span id="2594">2594</span>
+<span id="2595">2595</span>
+<span id="2596">2596</span>
+<span id="2597">2597</span>
+<span id="2598">2598</span>
+<span id="2599">2599</span>
+<span id="2600">2600</span>
+<span id="2601">2601</span>
+<span id="2602">2602</span>
+<span id="2603">2603</span>
+<span id="2604">2604</span>
+<span id="2605">2605</span>
+<span id="2606">2606</span>
+<span id="2607">2607</span>
+<span id="2608">2608</span>
+<span id="2609">2609</span>
+<span id="2610">2610</span>
+<span id="2611">2611</span>
+<span id="2612">2612</span>
+<span id="2613">2613</span>
+<span id="2614">2614</span>
+<span id="2615">2615</span>
+<span id="2616">2616</span>
+<span id="2617">2617</span>
+<span id="2618">2618</span>
+<span id="2619">2619</span>
+<span id="2620">2620</span>
+<span id="2621">2621</span>
+<span id="2622">2622</span>
+<span id="2623">2623</span>
+<span id="2624">2624</span>
+<span id="2625">2625</span>
+<span id="2626">2626</span>
+<span id="2627">2627</span>
+<span id="2628">2628</span>
+<span id="2629">2629</span>
+<span id="2630">2630</span>
+<span id="2631">2631</span>
+<span id="2632">2632</span>
+<span id="2633">2633</span>
+<span id="2634">2634</span>
+<span id="2635">2635</span>
+<span id="2636">2636</span>
+<span id="2637">2637</span>
+<span id="2638">2638</span>
+<span id="2639">2639</span>
+<span id="2640">2640</span>
+<span id="2641">2641</span>
+<span id="2642">2642</span>
+<span id="2643">2643</span>
+<span id="2644">2644</span>
+<span id="2645">2645</span>
+<span id="2646">2646</span>
+<span id="2647">2647</span>
+<span id="2648">2648</span>
+<span id="2649">2649</span>
+<span id="2650">2650</span>
+<span id="2651">2651</span>
+<span id="2652">2652</span>
+<span id="2653">2653</span>
+<span id="2654">2654</span>
+<span id="2655">2655</span>
+<span id="2656">2656</span>
+<span id="2657">2657</span>
+<span id="2658">2658</span>
+<span id="2659">2659</span>
+<span id="2660">2660</span>
+<span id="2661">2661</span>
+<span id="2662">2662</span>
+<span id="2663">2663</span>
+<span id="2664">2664</span>
+<span id="2665">2665</span>
+<span id="2666">2666</span>
+<span id="2667">2667</span>
+<span id="2668">2668</span>
+<span id="2669">2669</span>
+<span id="2670">2670</span>
+<span id="2671">2671</span>
+<span id="2672">2672</span>
+<span id="2673">2673</span>
+<span id="2674">2674</span>
+<span id="2675">2675</span>
+<span id="2676">2676</span>
+<span id="2677">2677</span>
+<span id="2678">2678</span>
+<span id="2679">2679</span>
+<span id="2680">2680</span>
+<span id="2681">2681</span>
+<span id="2682">2682</span>
+<span id="2683">2683</span>
+<span id="2684">2684</span>
+<span id="2685">2685</span>
+<span id="2686">2686</span>
+<span id="2687">2687</span>
+<span id="2688">2688</span>
+<span id="2689">2689</span>
+<span id="2690">2690</span>
+<span id="2691">2691</span>
+<span id="2692">2692</span>
+<span id="2693">2693</span>
+<span id="2694">2694</span>
+<span id="2695">2695</span>
+<span id="2696">2696</span>
+<span id="2697">2697</span>
+<span id="2698">2698</span>
+<span id="2699">2699</span>
+<span id="2700">2700</span>
+<span id="2701">2701</span>
+<span id="2702">2702</span>
+<span id="2703">2703</span>
+<span id="2704">2704</span>
+<span id="2705">2705</span>
+<span id="2706">2706</span>
+<span id="2707">2707</span>
+<span id="2708">2708</span>
+<span id="2709">2709</span>
+<span id="2710">2710</span>
+<span id="2711">2711</span>
+<span id="2712">2712</span>
+<span id="2713">2713</span>
+<span id="2714">2714</span>
+<span id="2715">2715</span>
+<span id="2716">2716</span>
+<span id="2717">2717</span>
+<span id="2718">2718</span>
+<span id="2719">2719</span>
+<span id="2720">2720</span>
+<span id="2721">2721</span>
+<span id="2722">2722</span>
+<span id="2723">2723</span>
+<span id="2724">2724</span>
+<span id="2725">2725</span>
+<span id="2726">2726</span>
+<span id="2727">2727</span>
+<span id="2728">2728</span>
+<span id="2729">2729</span>
+<span id="2730">2730</span>
+<span id="2731">2731</span>
+<span id="2732">2732</span>
+<span id="2733">2733</span>
+<span id="2734">2734</span>
+<span id="2735">2735</span>
+<span id="2736">2736</span>
+<span id="2737">2737</span>
+<span id="2738">2738</span>
+<span id="2739">2739</span>
+<span id="2740">2740</span>
+<span id="2741">2741</span>
+<span id="2742">2742</span>
+<span id="2743">2743</span>
+<span id="2744">2744</span>
+<span id="2745">2745</span>
+<span id="2746">2746</span>
+<span id="2747">2747</span>
+<span id="2748">2748</span>
+<span id="2749">2749</span>
+<span id="2750">2750</span>
+<span id="2751">2751</span>
+<span id="2752">2752</span>
+<span id="2753">2753</span>
+<span id="2754">2754</span>
+<span id="2755">2755</span>
+<span id="2756">2756</span>
+<span id="2757">2757</span>
+<span id="2758">2758</span>
+<span id="2759">2759</span>
+<span id="2760">2760</span>
+<span id="2761">2761</span>
+<span id="2762">2762</span>
+<span id="2763">2763</span>
+<span id="2764">2764</span>
+<span id="2765">2765</span>
+<span id="2766">2766</span>
+<span id="2767">2767</span>
+<span id="2768">2768</span>
+<span id="2769">2769</span>
+<span id="2770">2770</span>
+<span id="2771">2771</span>
+<span id="2772">2772</span>
+<span id="2773">2773</span>
+<span id="2774">2774</span>
+<span id="2775">2775</span>
+<span id="2776">2776</span>
+<span id="2777">2777</span>
+<span id="2778">2778</span>
+<span id="2779">2779</span>
+<span id="2780">2780</span>
+<span id="2781">2781</span>
+<span id="2782">2782</span>
+<span id="2783">2783</span>
+<span id="2784">2784</span>
+<span id="2785">2785</span>
+<span id="2786">2786</span>
+<span id="2787">2787</span>
+<span id="2788">2788</span>
+<span id="2789">2789</span>
+<span id="2790">2790</span>
+<span id="2791">2791</span>
+<span id="2792">2792</span>
+<span id="2793">2793</span>
+<span id="2794">2794</span>
+<span id="2795">2795</span>
+<span id="2796">2796</span>
+<span id="2797">2797</span>
+<span id="2798">2798</span>
+<span id="2799">2799</span>
+<span id="2800">2800</span>
+<span id="2801">2801</span>
+<span id="2802">2802</span>
+<span id="2803">2803</span>
+<span id="2804">2804</span>
+<span id="2805">2805</span>
+<span id="2806">2806</span>
+<span id="2807">2807</span>
+<span id="2808">2808</span>
+<span id="2809">2809</span>
+<span id="2810">2810</span>
+<span id="2811">2811</span>
+<span id="2812">2812</span>
+<span id="2813">2813</span>
+<span id="2814">2814</span>
+<span id="2815">2815</span>
+<span id="2816">2816</span>
+<span id="2817">2817</span>
+<span id="2818">2818</span>
+<span id="2819">2819</span>
+<span id="2820">2820</span>
+<span id="2821">2821</span>
+<span id="2822">2822</span>
+<span id="2823">2823</span>
+<span id="2824">2824</span>
+<span id="2825">2825</span>
+<span id="2826">2826</span>
+<span id="2827">2827</span>
+<span id="2828">2828</span>
+<span id="2829">2829</span>
+<span id="2830">2830</span>
+<span id="2831">2831</span>
+<span id="2832">2832</span>
+<span id="2833">2833</span>
+<span id="2834">2834</span>
+<span id="2835">2835</span>
+<span id="2836">2836</span>
+<span id="2837">2837</span>
+<span id="2838">2838</span>
+<span id="2839">2839</span>
+<span id="2840">2840</span>
+<span id="2841">2841</span>
+<span id="2842">2842</span>
+<span id="2843">2843</span>
+<span id="2844">2844</span>
+<span id="2845">2845</span>
+<span id="2846">2846</span>
+<span id="2847">2847</span>
+<span id="2848">2848</span>
+<span id="2849">2849</span>
+<span id="2850">2850</span>
+<span id="2851">2851</span>
+<span id="2852">2852</span>
+<span id="2853">2853</span>
+<span id="2854">2854</span>
+<span id="2855">2855</span>
+<span id="2856">2856</span>
+<span id="2857">2857</span>
+<span id="2858">2858</span>
+<span id="2859">2859</span>
+<span id="2860">2860</span>
+<span id="2861">2861</span>
+<span id="2862">2862</span>
+<span id="2863">2863</span>
+<span id="2864">2864</span>
+<span id="2865">2865</span>
+<span id="2866">2866</span>
+<span id="2867">2867</span>
+<span id="2868">2868</span>
+<span id="2869">2869</span>
+<span id="2870">2870</span>
+<span id="2871">2871</span>
+<span id="2872">2872</span>
+<span id="2873">2873</span>
+<span id="2874">2874</span>
+<span id="2875">2875</span>
+<span id="2876">2876</span>
+<span id="2877">2877</span>
+<span id="2878">2878</span>
+<span id="2879">2879</span>
+<span id="2880">2880</span>
+<span id="2881">2881</span>
+<span id="2882">2882</span>
+<span id="2883">2883</span>
+<span id="2884">2884</span>
+<span id="2885">2885</span>
+<span id="2886">2886</span>
+<span id="2887">2887</span>
+<span id="2888">2888</span>
+<span id="2889">2889</span>
+<span id="2890">2890</span>
+<span id="2891">2891</span>
+<span id="2892">2892</span>
+<span id="2893">2893</span>
+<span id="2894">2894</span>
+<span id="2895">2895</span>
+<span id="2896">2896</span>
+<span id="2897">2897</span>
+<span id="2898">2898</span>
+<span id="2899">2899</span>
+<span id="2900">2900</span>
+<span id="2901">2901</span>
+<span id="2902">2902</span>
+<span id="2903">2903</span>
+<span id="2904">2904</span>
+<span id="2905">2905</span>
+<span id="2906">2906</span>
+<span id="2907">2907</span>
+<span id="2908">2908</span>
+<span id="2909">2909</span>
+<span id="2910">2910</span>
+<span id="2911">2911</span>
+<span id="2912">2912</span>
+<span id="2913">2913</span>
+<span id="2914">2914</span>
+<span id="2915">2915</span>
+<span id="2916">2916</span>
+<span id="2917">2917</span>
+<span id="2918">2918</span>
+<span id="2919">2919</span>
+<span id="2920">2920</span>
+<span id="2921">2921</span>
+<span id="2922">2922</span>
+<span id="2923">2923</span>
+<span id="2924">2924</span>
+<span id="2925">2925</span>
+<span id="2926">2926</span>
+<span id="2927">2927</span>
+<span id="2928">2928</span>
+<span id="2929">2929</span>
+<span id="2930">2930</span>
+<span id="2931">2931</span>
+<span id="2932">2932</span>
+<span id="2933">2933</span>
+<span id="2934">2934</span>
+<span id="2935">2935</span>
+<span id="2936">2936</span>
+<span id="2937">2937</span>
+<span id="2938">2938</span>
+<span id="2939">2939</span>
+<span id="2940">2940</span>
+<span id="2941">2941</span>
+<span id="2942">2942</span>
+<span id="2943">2943</span>
+<span id="2944">2944</span>
+<span id="2945">2945</span>
+<span id="2946">2946</span>
+<span id="2947">2947</span>
+<span id="2948">2948</span>
+<span id="2949">2949</span>
+<span id="2950">2950</span>
+<span id="2951">2951</span>
+<span id="2952">2952</span>
+<span id="2953">2953</span>
+<span id="2954">2954</span>
+<span id="2955">2955</span>
+<span id="2956">2956</span>
+<span id="2957">2957</span>
+<span id="2958">2958</span>
+<span id="2959">2959</span>
+<span id="2960">2960</span>
+<span id="2961">2961</span>
+<span id="2962">2962</span>
+<span id="2963">2963</span>
+<span id="2964">2964</span>
+<span id="2965">2965</span>
+<span id="2966">2966</span>
+<span id="2967">2967</span>
+<span id="2968">2968</span>
+<span id="2969">2969</span>
+<span id="2970">2970</span>
+<span id="2971">2971</span>
+<span id="2972">2972</span>
+<span id="2973">2973</span>
+<span id="2974">2974</span>
+<span id="2975">2975</span>
+<span id="2976">2976</span>
+<span id="2977">2977</span>
+<span id="2978">2978</span>
+<span id="2979">2979</span>
+<span id="2980">2980</span>
+<span id="2981">2981</span>
+<span id="2982">2982</span>
+<span id="2983">2983</span>
+<span id="2984">2984</span>
+<span id="2985">2985</span>
+<span id="2986">2986</span>
+<span id="2987">2987</span>
+<span id="2988">2988</span>
+<span id="2989">2989</span>
+<span id="2990">2990</span>
+<span id="2991">2991</span>
+<span id="2992">2992</span>
+<span id="2993">2993</span>
+<span id="2994">2994</span>
+<span id="2995">2995</span>
+<span id="2996">2996</span>
+<span id="2997">2997</span>
+<span id="2998">2998</span>
+<span id="2999">2999</span>
+<span id="3000">3000</span>
+<span id="3001">3001</span>
+<span id="3002">3002</span>
+<span id="3003">3003</span>
+<span id="3004">3004</span>
+<span id="3005">3005</span>
+<span id="3006">3006</span>
+<span id="3007">3007</span>
+<span id="3008">3008</span>
+<span id="3009">3009</span>
+<span id="3010">3010</span>
+<span id="3011">3011</span>
+<span id="3012">3012</span>
+<span id="3013">3013</span>
+<span id="3014">3014</span>
+<span id="3015">3015</span>
+<span id="3016">3016</span>
+<span id="3017">3017</span>
+<span id="3018">3018</span>
+<span id="3019">3019</span>
+<span id="3020">3020</span>
+<span id="3021">3021</span>
+<span id="3022">3022</span>
+<span id="3023">3023</span>
+<span id="3024">3024</span>
+<span id="3025">3025</span>
+<span id="3026">3026</span>
+<span id="3027">3027</span>
+<span id="3028">3028</span>
+<span id="3029">3029</span>
+<span id="3030">3030</span>
+<span id="3031">3031</span>
+<span id="3032">3032</span>
+<span id="3033">3033</span>
+<span id="3034">3034</span>
+<span id="3035">3035</span>
+<span id="3036">3036</span>
+<span id="3037">3037</span>
+<span id="3038">3038</span>
+<span id="3039">3039</span>
+<span id="3040">3040</span>
+<span id="3041">3041</span>
+<span id="3042">3042</span>
+<span id="3043">3043</span>
+<span id="3044">3044</span>
+<span id="3045">3045</span>
+<span id="3046">3046</span>
+<span id="3047">3047</span>
+<span id="3048">3048</span>
+<span id="3049">3049</span>
+<span id="3050">3050</span>
+<span id="3051">3051</span>
+<span id="3052">3052</span>
+<span id="3053">3053</span>
+<span id="3054">3054</span>
+<span id="3055">3055</span>
+<span id="3056">3056</span>
+<span id="3057">3057</span>
+<span id="3058">3058</span>
+<span id="3059">3059</span>
+<span id="3060">3060</span>
+<span id="3061">3061</span>
+<span id="3062">3062</span>
+<span id="3063">3063</span>
+<span id="3064">3064</span>
+<span id="3065">3065</span>
+<span id="3066">3066</span>
+<span id="3067">3067</span>
+<span id="3068">3068</span>
+<span id="3069">3069</span>
+<span id="3070">3070</span>
+<span id="3071">3071</span>
+<span id="3072">3072</span>
+<span id="3073">3073</span>
+<span id="3074">3074</span>
+<span id="3075">3075</span>
+<span id="3076">3076</span>
+<span id="3077">3077</span>
+<span id="3078">3078</span>
+<span id="3079">3079</span>
+<span id="3080">3080</span>
+<span id="3081">3081</span>
+<span id="3082">3082</span>
+<span id="3083">3083</span>
+<span id="3084">3084</span>
+<span id="3085">3085</span>
+<span id="3086">3086</span>
+<span id="3087">3087</span>
+<span id="3088">3088</span>
+<span id="3089">3089</span>
+<span id="3090">3090</span>
+<span id="3091">3091</span>
+<span id="3092">3092</span>
+<span id="3093">3093</span>
+<span id="3094">3094</span>
+<span id="3095">3095</span>
+<span id="3096">3096</span>
+<span id="3097">3097</span>
+<span id="3098">3098</span>
+<span id="3099">3099</span>
+<span id="3100">3100</span>
+<span id="3101">3101</span>
+<span id="3102">3102</span>
+<span id="3103">3103</span>
+<span id="3104">3104</span>
+<span id="3105">3105</span>
+<span id="3106">3106</span>
+<span id="3107">3107</span>
+<span id="3108">3108</span>
+<span id="3109">3109</span>
+<span id="3110">3110</span>
+<span id="3111">3111</span>
+<span id="3112">3112</span>
+<span id="3113">3113</span>
+<span id="3114">3114</span>
+<span id="3115">3115</span>
+<span id="3116">3116</span>
+<span id="3117">3117</span>
+<span id="3118">3118</span>
+<span id="3119">3119</span>
+<span id="3120">3120</span>
+<span id="3121">3121</span>
+<span id="3122">3122</span>
+<span id="3123">3123</span>
+<span id="3124">3124</span>
+<span id="3125">3125</span>
+<span id="3126">3126</span>
+<span id="3127">3127</span>
+<span id="3128">3128</span>
+<span id="3129">3129</span>
+<span id="3130">3130</span>
+<span id="3131">3131</span>
+<span id="3132">3132</span>
+<span id="3133">3133</span>
+<span id="3134">3134</span>
+<span id="3135">3135</span>
+<span id="3136">3136</span>
+<span id="3137">3137</span>
+<span id="3138">3138</span>
+<span id="3139">3139</span>
+<span id="3140">3140</span>
+<span id="3141">3141</span>
+<span id="3142">3142</span>
+<span id="3143">3143</span>
+<span id="3144">3144</span>
+<span id="3145">3145</span>
+<span id="3146">3146</span>
+<span id="3147">3147</span>
+<span id="3148">3148</span>
+<span id="3149">3149</span>
+<span id="3150">3150</span>
+<span id="3151">3151</span>
+<span id="3152">3152</span>
+<span id="3153">3153</span>
+<span id="3154">3154</span>
+<span id="3155">3155</span>
+<span id="3156">3156</span>
+<span id="3157">3157</span>
+<span id="3158">3158</span>
+<span id="3159">3159</span>
+<span id="3160">3160</span>
+<span id="3161">3161</span>
+<span id="3162">3162</span>
+<span id="3163">3163</span>
+<span id="3164">3164</span>
+<span id="3165">3165</span>
+<span id="3166">3166</span>
+<span id="3167">3167</span>
+<span id="3168">3168</span>
+<span id="3169">3169</span>
+<span id="3170">3170</span>
+<span id="3171">3171</span>
+<span id="3172">3172</span>
+<span id="3173">3173</span>
+<span id="3174">3174</span>
+<span id="3175">3175</span>
+<span id="3176">3176</span>
+<span id="3177">3177</span>
+<span id="3178">3178</span>
+<span id="3179">3179</span>
+<span id="3180">3180</span>
+<span id="3181">3181</span>
+<span id="3182">3182</span>
+<span id="3183">3183</span>
+<span id="3184">3184</span>
+<span id="3185">3185</span>
+<span id="3186">3186</span>
+<span id="3187">3187</span>
+<span id="3188">3188</span>
+<span id="3189">3189</span>
+<span id="3190">3190</span>
+<span id="3191">3191</span>
+<span id="3192">3192</span>
+<span id="3193">3193</span>
+<span id="3194">3194</span>
+<span id="3195">3195</span>
+<span id="3196">3196</span>
+<span id="3197">3197</span>
+<span id="3198">3198</span>
+<span id="3199">3199</span>
+<span id="3200">3200</span>
+<span id="3201">3201</span>
+<span id="3202">3202</span>
+<span id="3203">3203</span>
+<span id="3204">3204</span>
+<span id="3205">3205</span>
+<span id="3206">3206</span>
+<span id="3207">3207</span>
+<span id="3208">3208</span>
+<span id="3209">3209</span>
+<span id="3210">3210</span>
+<span id="3211">3211</span>
+<span id="3212">3212</span>
+<span id="3213">3213</span>
+<span id="3214">3214</span>
+<span id="3215">3215</span>
+<span id="3216">3216</span>
+<span id="3217">3217</span>
+<span id="3218">3218</span>
+<span id="3219">3219</span>
+<span id="3220">3220</span>
+<span id="3221">3221</span>
+<span id="3222">3222</span>
+<span id="3223">3223</span>
+<span id="3224">3224</span>
+<span id="3225">3225</span>
+<span id="3226">3226</span>
+<span id="3227">3227</span>
+<span id="3228">3228</span>
+<span id="3229">3229</span>
+<span id="3230">3230</span>
+<span id="3231">3231</span>
+<span id="3232">3232</span>
+<span id="3233">3233</span>
+<span id="3234">3234</span>
+<span id="3235">3235</span>
+<span id="3236">3236</span>
+<span id="3237">3237</span>
+<span id="3238">3238</span>
+<span id="3239">3239</span>
+<span id="3240">3240</span>
+<span id="3241">3241</span>
+<span id="3242">3242</span>
+<span id="3243">3243</span>
+<span id="3244">3244</span>
+<span id="3245">3245</span>
+<span id="3246">3246</span>
+<span id="3247">3247</span>
+<span id="3248">3248</span>
+<span id="3249">3249</span>
+<span id="3250">3250</span>
+<span id="3251">3251</span>
+<span id="3252">3252</span>
+<span id="3253">3253</span>
+<span id="3254">3254</span>
+<span id="3255">3255</span>
+<span id="3256">3256</span>
+<span id="3257">3257</span>
+<span id="3258">3258</span>
+<span id="3259">3259</span>
+<span id="3260">3260</span>
+<span id="3261">3261</span>
+<span id="3262">3262</span>
+<span id="3263">3263</span>
+<span id="3264">3264</span>
+<span id="3265">3265</span>
+<span id="3266">3266</span>
+<span id="3267">3267</span>
+<span id="3268">3268</span>
+<span id="3269">3269</span>
+<span id="3270">3270</span>
+<span id="3271">3271</span>
+<span id="3272">3272</span>
+<span id="3273">3273</span>
+<span id="3274">3274</span>
+<span id="3275">3275</span>
+<span id="3276">3276</span>
+<span id="3277">3277</span>
+<span id="3278">3278</span>
+<span id="3279">3279</span>
+<span id="3280">3280</span>
+<span id="3281">3281</span>
+<span id="3282">3282</span>
+<span id="3283">3283</span>
+<span id="3284">3284</span>
+<span id="3285">3285</span>
+<span id="3286">3286</span>
+<span id="3287">3287</span>
+<span id="3288">3288</span>
+<span id="3289">3289</span>
+<span id="3290">3290</span>
+<span id="3291">3291</span>
+<span id="3292">3292</span>
+<span id="3293">3293</span>
+<span id="3294">3294</span>
+<span id="3295">3295</span>
+<span id="3296">3296</span>
+<span id="3297">3297</span>
+<span id="3298">3298</span>
+<span id="3299">3299</span>
+<span id="3300">3300</span>
+<span id="3301">3301</span>
+<span id="3302">3302</span>
+<span id="3303">3303</span>
+<span id="3304">3304</span>
+<span id="3305">3305</span>
+<span id="3306">3306</span>
+<span id="3307">3307</span>
+<span id="3308">3308</span>
+<span id="3309">3309</span>
+<span id="3310">3310</span>
+<span id="3311">3311</span>
+<span id="3312">3312</span>
+<span id="3313">3313</span>
+<span id="3314">3314</span>
+<span id="3315">3315</span>
+<span id="3316">3316</span>
+<span id="3317">3317</span>
+<span id="3318">3318</span>
+<span id="3319">3319</span>
+<span id="3320">3320</span>
+<span id="3321">3321</span>
+<span id="3322">3322</span>
+<span id="3323">3323</span>
+<span id="3324">3324</span>
+<span id="3325">3325</span>
+<span id="3326">3326</span>
+<span id="3327">3327</span>
+<span id="3328">3328</span>
+<span id="3329">3329</span>
+<span id="3330">3330</span>
+<span id="3331">3331</span>
+<span id="3332">3332</span>
+<span id="3333">3333</span>
+<span id="3334">3334</span>
+<span id="3335">3335</span>
+<span id="3336">3336</span>
+<span id="3337">3337</span>
+<span id="3338">3338</span>
+<span id="3339">3339</span>
+<span id="3340">3340</span>
+<span id="3341">3341</span>
+<span id="3342">3342</span>
+<span id="3343">3343</span>
+<span id="3344">3344</span>
+<span id="3345">3345</span>
+<span id="3346">3346</span>
+<span id="3347">3347</span>
+<span id="3348">3348</span>
+<span id="3349">3349</span>
+<span id="3350">3350</span>
+<span id="3351">3351</span>
+<span id="3352">3352</span>
+<span id="3353">3353</span>
+<span id="3354">3354</span>
+<span id="3355">3355</span>
+<span id="3356">3356</span>
+<span id="3357">3357</span>
+<span id="3358">3358</span>
+<span id="3359">3359</span>
+<span id="3360">3360</span>
+<span id="3361">3361</span>
+<span id="3362">3362</span>
+<span id="3363">3363</span>
+<span id="3364">3364</span>
+<span id="3365">3365</span>
+<span id="3366">3366</span>
+<span id="3367">3367</span>
+<span id="3368">3368</span>
+<span id="3369">3369</span>
+<span id="3370">3370</span>
+<span id="3371">3371</span>
+<span id="3372">3372</span>
+<span id="3373">3373</span>
+<span id="3374">3374</span>
+<span id="3375">3375</span>
+<span id="3376">3376</span>
+<span id="3377">3377</span>
+<span id="3378">3378</span>
+<span id="3379">3379</span>
+<span id="3380">3380</span>
+<span id="3381">3381</span>
+<span id="3382">3382</span>
+<span id="3383">3383</span>
+<span id="3384">3384</span>
+<span id="3385">3385</span>
+<span id="3386">3386</span>
+<span id="3387">3387</span>
+<span id="3388">3388</span>
+<span id="3389">3389</span>
+<span id="3390">3390</span>
+<span id="3391">3391</span>
+<span id="3392">3392</span>
+<span id="3393">3393</span>
+<span id="3394">3394</span>
+<span id="3395">3395</span>
+<span id="3396">3396</span>
+<span id="3397">3397</span>
+<span id="3398">3398</span>
+<span id="3399">3399</span>
+<span id="3400">3400</span>
+<span id="3401">3401</span>
+<span id="3402">3402</span>
+<span id="3403">3403</span>
+<span id="3404">3404</span>
+<span id="3405">3405</span>
+<span id="3406">3406</span>
+<span id="3407">3407</span>
+<span id="3408">3408</span>
+<span id="3409">3409</span>
+<span id="3410">3410</span>
+<span id="3411">3411</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">secp256k1</span>::<span class="ident">Secp256k1</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">base58</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">raw</span>::<span class="ident">Key</span> <span class="kw">as</span> <span class="ident">PSBTKey</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">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">psbt</span>::<span class="ident">PsbtInputSatisfier</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">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">BumpFee</span>, <span class="ident">CreateTx</span>, <span class="ident">FeePolicy</span>, <span class="ident">TxBuilder</span>, <span class="ident">TxBuilderContext</span>};
+<span class="kw">use</span> <span class="ident">utils</span>::{<span class="ident">check_nlocktime</span>, <span class="ident">check_nsequence_rbf</span>, <span class="ident">descriptor_to_pk_ctx</span>, <span class="ident">After</span>, <span class="ident">Older</span>, <span class="ident">SecpCtx</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="ident">ToWalletDescriptor</span>, <span class="ident">XKeyUtils</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`](trait@crate::database::Database) and a</span>
+<span class="doccomment">/// [`blockchain`](trait@crate::blockchain::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">D</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">change_signers</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">SignersContainer</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">dyn</span> <span class="ident">AddressValidator</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="ident">secp</span>: <span class="ident">SecpCtx</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="op"><</span><span class="ident">E</span>: <span class="ident">ToWalletDescriptor</span><span class="op">></span>(
+ <span class="ident">descriptor</span>: <span class="ident">E</span>,
+ <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">E</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="kw">let</span> (<span class="ident">descriptor</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">descriptor</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)<span class="question-mark">?</span>;
+ <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
+ <span class="ident">KeychainKind</span>::<span class="ident">External</span>,
+ <span class="ident">get_checksum</span>(<span class="kw-2">&</span><span class="ident">descriptor</span>.<span class="ident">to_string</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">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="kw">let</span> (<span class="ident">change_descriptor</span>, <span class="ident">change_keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">network</span>)<span class="question-mark">?</span>;
+ <span class="ident">database</span>.<span class="ident">check_descriptor_checksum</span>(
+ <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>,
+ <span class="ident">get_checksum</span>(<span class="kw-2">&</span><span class="ident">change_descriptor</span>.<span class="ident">to_string</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_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="ident">secp</span>: <span class="ident">Secp256k1</span>::<span class="ident">new</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">KeychainKind</span>::<span class="ident">External</span>)<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>);
+
+ <span class="self">self</span>.<span class="ident">descriptor</span>
+ .<span class="ident">derive</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">address</span>(<span class="self">self</span>.<span class="ident">network</span>, <span class="ident">deriv_ctx</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">keychain</span>: <span class="ident">KeychainKind</span>,
+ <span class="ident">id</span>: <span class="ident">SignerId</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">dyn</span> <span class="ident">Signer</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">keychain</span> {
+ <span class="ident">KeychainKind</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">KeychainKind</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">dyn</span> <span class="ident">AddressValidator</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="ident">D</span><span class="op">></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">D</span>, <span class="ident">Cs</span>, <span class="ident">CreateTx</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="ident">external_policy</span> <span class="op">=</span> <span class="self">self</span>
+ .<span class="ident">descriptor</span>
+ .<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>)<span class="question-mark">?</span>
+ .<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">internal_policy</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">map</span>(<span class="op">|</span><span class="ident">desc</span><span class="op">|</span> {
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span>(
+ <span class="ident">desc</span>.<span class="ident">extract_policy</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">change_signers</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>)<span class="question-mark">?</span>
+ .<span class="ident">unwrap</span>(),
+ )
+ })
+ .<span class="ident">transpose</span>()<span class="question-mark">?</span>;
+
+ <span class="comment">// The policy allows spending external outputs, but it requires a policy path that hasn't been</span>
+ <span class="comment">// provided</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">OnlyChange</span>
+ <span class="op">&&</span> <span class="ident">external_policy</span>.<span class="ident">requires_path</span>()
+ <span class="op">&&</span> <span class="ident">builder</span>.<span class="ident">external_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="ident">KeychainKind</span>::<span class="ident">External</span>));
+ };
+ <span class="comment">// Same for the internal_policy path, if present</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">internal_policy</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">internal_policy</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">ChangeForbidden</span>
+ <span class="op">&&</span> <span class="ident">internal_policy</span>.<span class="ident">requires_path</span>()
+ <span class="op">&&</span> <span class="ident">builder</span>.<span class="ident">internal_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="ident">KeychainKind</span>::<span class="ident">Internal</span>));
+ };
+ }
+
+ <span class="kw">let</span> <span class="ident">external_requirements</span> <span class="op">=</span> <span class="ident">external_policy</span>.<span class="ident">get_condition</span>(
+ <span class="ident">builder</span>
+ .<span class="ident">external_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="kw">let</span> <span class="ident">internal_requirements</span> <span class="op">=</span> <span class="ident">internal_policy</span>
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">policy</span><span class="op">|</span> {
+ <span class="prelude-val">Ok</span>::<span class="op"><</span><span class="kw">_</span>, <span class="ident">Error</span><span class="op">></span>(
+ <span class="ident">policy</span>.<span class="ident">get_condition</span>(
+ <span class="ident">builder</span>
+ .<span class="ident">internal_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="ident">transpose</span>()<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> <span class="ident">requirements</span> <span class="op">=</span> <span class="ident">external_requirements</span>
+ .<span class="ident">clone</span>()
+ .<span class="ident">merge</span>(<span class="kw-2">&</span><span class="ident">internal_requirements</span>.<span class="ident">unwrap_or_default</span>())<span class="question-mark">?</span>;
+ <span class="macro">debug</span><span class="macro">!</span>(<span class="string">"Policy 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="comment">// No nLockTime, default to 0</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="comment">// Specific nLockTime required and we have no constraints, so just set to that value</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="comment">// Specific nLockTime required and it's compatible with the constraints</span>
+ <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="kw">if</span> <span class="ident">check_nlocktime</span>(<span class="ident">x</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="comment">// Invalid nLockTime required</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="comment">// No RBF or CSV but there's an nLockTime, so the nSequence cannot be final</span>
+ (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="kw">if</span> <span class="ident">lock_time</span> <span class="op">!</span><span class="op">=</span> <span class="number">0</span> <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFE</span>,
+ <span class="comment">// No RBF, CSV or nLockTime, make the transaction final</span>
+ (<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFF</span>,
+
+ <span class="comment">// No RBF requested, use the value from CSV. Note that this value is by definition</span>
+ <span class="comment">// non-final, so even if a timelock is enabled this nSequence is fine, hence why we</span>
+ <span class="comment">// don't bother checking for it here. The same is true for all the other branches below</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="comment">// RBF with a specific value but that value is too high</span>
+ (<span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">RBFValue</span>::<span class="ident">Value</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="comment">// RBF with a specific value requested, but the value is incompatible with CSV</span>
+ (<span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">RBFValue</span>::<span class="ident">Value</span>(<span class="ident">rbf</span>)), <span class="prelude-val">Some</span>(<span class="ident">csv</span>))
+ <span class="kw">if</span> <span class="op">!</span><span class="ident">check_nsequence_rbf</span>(<span class="ident">rbf</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 `{}` given a required OP_CSV of `{}`"</span>,
+ <span class="ident">rbf</span>, <span class="ident">csv</span>
+ )))
+ }
+
+ <span class="comment">// RBF enabled with the default value with CSV also enabled. CSV takes precedence</span>
+ (<span class="prelude-val">Some</span>(<span class="ident">tx_builder</span>::<span class="ident">RBFValue</span>::<span class="ident">Default</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="comment">// Valid RBF, either default or with a specific value. We ignore the `CSV` value</span>
+ <span class="comment">// because we've already checked it before</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="ident">get_value</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="kw-2">mut</span> <span class="ident">fee_amount</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>
+ .<span class="ident">fee_policy</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="ident">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">FeeRate</span>::<span class="ident">default</span>()))
+ {
+ <span class="ident">FeePolicy</span>::<span class="ident">FeeAmount</span>(<span class="ident">amount</span>) <span class="op">=</span><span class="op">></span> (<span class="ident">FeeRate</span>::<span class="ident">from_sat_per_vb</span>(<span class="number">0.0</span>), <span class="kw-2">*</span><span class="ident">amount</span> <span class="kw">as</span> <span class="ident">f32</span>),
+ <span class="ident">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">rate</span>) <span class="op">=</span><span class="op">></span> (<span class="kw-2">*</span><span class="ident">rate</span>, <span class="number">0.0</span>),
+ };
+
+ <span class="comment">// try not to move from `builder` because we still need to use it later.</span>
+ <span class="kw">let</span> <span class="ident">recipients</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">single_recipient</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">recipient</span>) <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">recipient</span>, <span class="number">0</span>)],
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">builder</span>.<span class="ident">recipients</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">r</span>, <span class="ident">v</span>)<span class="op">|</span> (<span class="ident">r</span>, <span class="kw-2">*</span><span class="ident">v</span>)).<span class="ident">collect</span>(),
+ };
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">single_recipient</span>.<span class="ident">is_some</span>()
+ <span class="op">&&</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">manually_selected_only</span>
+ <span class="op">&&</span> <span class="op">!</span><span class="ident">builder</span>.<span class="ident">drain_wallet</span>
+ {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">SingleRecipientNoInputs</span>);
+ }
+ <span class="kw">if</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">NoRecipients</span>);
+ }
+
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">manually_selected_only</span> <span class="op">&&</span> <span class="ident">builder</span>.<span class="ident">utxos</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">NoUtxosSelected</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">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">recipients</span>.<span class="ident">into_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">single_recipient</span> {
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="number">0</span>,
+ <span class="prelude-val">None</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="prelude-val">None</span> <span class="op">=</span><span class="op">></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="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="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">required_utxos</span>, <span class="ident">optional_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">preselect_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">unspendable</span>,
+ <span class="kw-2">&</span><span class="ident">builder</span>.<span class="ident">utxos</span>,
+ <span class="ident">builder</span>.<span class="ident">drain_wallet</span>,
+ <span class="ident">builder</span>.<span class="ident">manually_selected_only</span>,
+ <span class="bool-val">false</span>, <span class="comment">// we don't mind using unconfirmed outputs here, hopefully coin selection will sort this out?</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">selected</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="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">deref</span>(),
+ <span class="ident">required_utxos</span>,
+ <span class="ident">optional_utxos</span>,
+ <span class="ident">fee_rate</span>,
+ <span class="ident">outgoing</span>,
+ <span class="ident">fee_amount</span>,
+ )<span class="question-mark">?</span>;
+ <span class="ident">tx</span>.<span class="ident">input</span> <span class="op">=</span> <span class="ident">selected</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="ident">bitcoin</span>::<span class="ident">TxIn</span> {
+ <span class="ident">previous_output</span>: <span class="ident">u</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="ident">n_sequence</span>,
+ <span class="ident">witness</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ })
+ .<span class="ident">collect</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">single_recipient</span> {
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">None</span>,
+ <span class="prelude-val">None</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="ident">saturating_sub</span>(<span class="ident">fee_amount</span>);
+
+ <span class="kw">match</span> <span class="ident">change_output</span> {
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">change_val</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// single recipient, 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="prelude-val">Some</span>(<span class="kw">_</span>) <span class="kw">if</span> <span class="ident">change_val</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></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">selected_amount</span> <span class="op">-</span> <span class="ident">outgoing</span>;
+ }
+ <span class="prelude-val">Some</span>(<span class="kw-2">mut</span> <span class="ident">change_output</span>) <span class="op">=</span><span class="op">></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="prelude-val">None</span> <span class="op">=</span><span class="op">></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">// the single recipient is 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="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">selected</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::set_single_recipient`],</span>
+ <span class="doccomment">/// the [`TxBuilder::maintain_single_recipient`] flag should be enabled to correctly reduce the</span>
+ <span class="doccomment">/// only output's value in order to increase the fees.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If the `builder` specifies some `utxos` that must be spent, they will be added to the</span>
+ <span class="doccomment">/// transaction regardless of whether they are necessary or not to cover additional 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="ident">D</span><span class="op">></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">D</span>, <span class="ident">Cs</span>, <span class="ident">BumpFee</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="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 `single_recipient`</span>
+ <span class="kw">let</span> <span class="ident">updatable_output</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">single_recipient</span> {
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="kw">if</span> <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">len</span>() <span class="op">!</span><span class="op">=</span> <span class="number">1</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">SingleRecipientMultipleOutputs</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="number">0</span>),
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></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 KeychainKind. We use</span>
+ <span class="comment">// `get_descriptor_for` to find what's the KeychainKind 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_keychain</span>(<span class="ident">KeychainKind</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">keychain</span>, <span class="kw">_</span>)) <span class="kw">if</span> <span class="ident">keychain</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="ident">change_output</span>
+ }
+ };
+ <span class="kw">let</span> <span class="ident">updatable_output</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">updatable_output</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">updatable_output</span>) <span class="op">=</span><span class="op">></span> <span class="ident">updatable_output</span>,
+ <span class="prelude-val">None</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">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">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">change_txout</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="comment">// initially always remove the output we can change</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">removed_updatable_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_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">removed_updatable_output</span>.<span class="ident">value</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>);
+ <span class="kw">let</span> <span class="ident">original_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="comment">// remove the inputs from the tx and process them</span>
+ <span class="kw">let</span> <span class="ident">original_txin</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">input</span>.<span class="ident">drain</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="kw-2">mut</span> <span class="ident">original_utxos</span> <span class="op">=</span> <span class="ident">original_txin</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="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">txout</span> <span class="op">=</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">ok_or</span>(<span class="ident">Error</span>::<span class="ident">UnknownUTXO</span>)<span class="question-mark">?</span>;
+
+ <span class="kw">let</span> (<span class="ident">weight</span>, <span class="ident">keychain</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">txout</span>.<span class="ident">script_pubkey</span>)<span class="question-mark">?</span>
+ {
+ <span class="prelude-val">Some</span>((<span class="ident">keychain</span>, <span class="kw">_</span>)) <span class="op">=</span><span class="op">></span> (
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">keychain</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(<span class="ident">deriv_ctx</span>)
+ .<span class="ident">unwrap</span>(),
+ <span class="ident">keychain</span>,
+ ),
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// estimate the weight based on the scriptsig/witness size present in the</span>
+ <span class="comment">// original transaction</span>
+ <span class="kw">let</span> <span class="ident">weight</span> <span class="op">=</span>
+ <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">script_sig</span>).<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">+</span> <span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">txin</span>.<span class="ident">witness</span>).<span class="ident">len</span>();
+ (<span class="ident">weight</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</span>)
+ }
+ };
+
+ <span class="kw">let</span> <span class="ident">utxo</span> <span class="op">=</span> <span class="ident">UTXO</span> {
+ <span class="ident">outpoint</span>: <span class="ident">txin</span>.<span class="ident">previous_output</span>,
+ <span class="ident">txout</span>,
+ <span class="ident">keychain</span>,
+ };
+
+ <span class="prelude-val">Ok</span>((<span class="ident">utxo</span>, <span class="ident">weight</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="ident">builder</span>.<span class="ident">manually_selected_only</span> <span class="op">&&</span> <span class="ident">builder</span>.<span class="ident">utxos</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">NoUtxosSelected</span>);
+ }
+
+ <span class="kw">let</span> <span class="ident">builder_extra_utxos</span> <span class="op">=</span> <span class="ident">builder</span>
+ .<span class="ident">utxos</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">original_txin</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="op">&&</span><span class="ident">txin</span>.<span class="ident">previous_output</span> <span class="op">=</span><span class="op">=</span> <span class="ident">utxo</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="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">required_utxos</span>, <span class="ident">optional_utxos</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">preselect_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">unspendable</span>,
+ <span class="kw-2">&</span><span class="ident">builder_extra_utxos</span>[..],
+ <span class="ident">builder</span>.<span class="ident">drain_wallet</span>,
+ <span class="ident">builder</span>.<span class="ident">manually_selected_only</span>,
+ <span class="bool-val">true</span>, <span class="comment">// we only want confirmed transactions for RBF</span>
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">required_utxos</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">original_utxos</span>);
+
+ <span class="kw">let</span> <span class="ident">amount_needed</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">output</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">out</span><span class="op">|</span> <span class="ident">acc</span> <span class="op">+</span> <span class="ident">out</span>.<span class="ident">value</span>);
+ <span class="kw">let</span> (<span class="ident">new_feerate</span>, <span class="ident">initial_fee</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">builder</span>
+ .<span class="ident">fee_policy</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">unwrap_or</span>(<span class="kw-2">&</span><span class="ident">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">FeeRate</span>::<span class="ident">default</span>()))
+ {
+ <span class="ident">FeePolicy</span>::<span class="ident">FeeAmount</span>(<span class="ident">amount</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw-2">*</span><span class="ident">amount</span> <span class="op"><</span> <span class="ident">details</span>.<span class="ident">fees</span> {
+ <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">Error</span>::<span class="ident">FeeTooLow</span> {
+ <span class="ident">required</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">0.0</span>), <span class="kw-2">*</span><span class="ident">amount</span> <span class="kw">as</span> <span class="ident">f32</span>)
+ }
+ <span class="ident">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">rate</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">if</span> <span class="kw-2">*</span><span class="ident">rate</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-2">*</span><span class="ident">rate</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="op">*</span> <span class="ident">rate</span>.<span class="ident">as_sat_vb</span>())
+ }
+ };
+
+ <span class="kw">let</span> <span class="ident">coin_selection</span>::<span class="ident">CoinSelectionResult</span> {
+ <span class="ident">selected</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="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow</span>().<span class="ident">deref</span>(),
+ <span class="ident">required_utxos</span>,
+ <span class="ident">optional_utxos</span>,
+ <span class="ident">new_feerate</span>,
+ <span class="ident">amount_needed</span>,
+ <span class="ident">initial_fee</span>,
+ )<span class="question-mark">?</span>;
+
+ <span class="ident">tx</span>.<span class="ident">input</span> <span class="op">=</span> <span class="ident">selected</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="ident">bitcoin</span>::<span class="ident">TxIn</span> {
+ <span class="ident">previous_output</span>: <span class="ident">u</span>.<span class="ident">outpoint</span>,
+ <span class="ident">script_sig</span>: <span class="ident">Script</span>::<span class="ident">default</span>(),
+ <span class="comment">// TODO: use builder.n_sequence??</span>
+ <span class="ident">sequence</span>: <span class="ident">original_sequence</span>,
+ <span class="ident">witness</span>: <span class="macro">vec</span><span class="macro">!</span>[],
+ })
+ .<span class="ident">collect</span>();
+
+ <span class="ident">details</span>.<span class="ident">sent</span> <span class="op">=</span> <span class="ident">selected_amount</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">removed_output_fee_cost</span> <span class="op">=</span> (<span class="ident">serialize</span>(<span class="kw-2">&</span><span class="ident">removed_updatable_output</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="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">amount_needed</span> <span class="op">-</span> <span class="ident">fee_amount</span>;
+ <span class="kw">let</span> <span class="ident">change_val_after_add</span> <span class="op">=</span> <span class="ident">change_val</span>.<span class="ident">saturating_sub</span>(<span class="ident">removed_output_fee_cost</span>);
+ <span class="kw">match</span> <span class="ident">builder</span>.<span class="ident">single_recipient</span> {
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">change_val_after_add</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></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="prelude-val">Some</span>(<span class="kw">_</span>) <span class="kw">if</span> <span class="ident">change_val_after_add</span>.<span class="ident">is_dust</span>() <span class="op">=</span><span class="op">></span> {
+ <span class="comment">// single_recipient 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="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
+ <span class="ident">removed_updatable_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val_after_add</span>;
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">removed_output_fee_cost</span>;
+ <span class="ident">details</span>.<span class="ident">received</span> <span class="op">+</span><span class="op">=</span> <span class="ident">change_val_after_add</span>;
+
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">removed_updatable_output</span>);
+ }
+ <span class="prelude-val">Some</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="ident">removed_updatable_output</span>.<span class="ident">value</span> <span class="op">=</span> <span class="ident">change_val_after_add</span>;
+ <span class="ident">fee_amount</span> <span class="op">+</span><span class="op">=</span> <span class="ident">removed_output_fee_cost</span>;
+
+ <span class="comment">// single recipient and it's 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">removed_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="ident">change_val_after_add</span>;
+ }
+
+ <span class="ident">tx</span>.<span class="ident">output</span>.<span class="ident">push</span>(<span class="ident">removed_updatable_output</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">fees</span> <span class="op">=</span> <span class="ident">fee_amount</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">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">selected</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
+ (<span class="ident">KeychainKind</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="kw-2">&</span><span class="self">self</span>.<span class="ident">signers</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>)<span class="question-mark">?</span>)
+ }
+ (<span class="ident">KeychainKind</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">KeychainKind</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="kw-2">&</span><span class="self">self</span>.<span class="ident">change_signers</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</span>, <span class="self">self</span>.<span class="ident">change_descriptor</span>.<span class="ident">as_ref</span>()) {
+ (<span class="ident">KeychainKind</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">KeychainKind</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">KeychainKind</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="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="kw">let</span> <span class="kw-2">mut</span> <span class="ident">finished</span> <span class="op">=</span> <span class="bool-val">true</span>;
+
+ <span class="kw">for</span> (<span class="ident">n</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">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">n</span>];
+ <span class="kw">if</span> <span class="ident">psbt_input</span>.<span class="ident">final_script_sig</span>.<span class="ident">is_some</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">psbt_input</span>.<span class="ident">final_script_witness</span>.<span class="ident">is_some</span>() {
+ <span class="kw">continue</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">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="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 `keychain` 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="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">or_else</span>(<span class="op">|</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>,
+ )
+ })
+ .<span class="ident">or_else</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">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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>)
+ })
+ });
+
+ <span class="kw">match</span> <span class="ident">desc</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">desc</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tmp_input</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">TxIn</span>::<span class="ident">default</span>();
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>);
+ <span class="kw">match</span> <span class="ident">desc</span>.<span class="ident">satisfy</span>(
+ <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">tmp_input</span>,
+ (
+ <span class="ident">PsbtInputSatisfier</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="ident">psbt</span>, <span class="ident">n</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="ident">deriv_ctx</span>,
+ ) {
+ <span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">psbt_input</span> <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">psbt</span>.<span class="ident">inputs</span>[<span class="ident">n</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">tmp_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">tmp_input</span>.<span class="ident">witness</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="ident">finished</span> <span class="op">=</span> <span class="bool-val">false</span>
+ }
+ }
+ }
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">finished</span> <span class="op">=</span> <span class="bool-val">false</span>,
+ }
+ }
+
+ <span class="prelude-val">Ok</span>((<span class="ident">psbt</span>, <span class="ident">finished</span>))
+ }
+
+ <span class="doccomment">/// Return the secp256k1 context used for all signing operations</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">secp_ctx</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">SecpCtx</span> {
+ <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>
+ }
+
+ <span class="comment">// Internals</span>
+
+ <span class="kw">fn</span> <span class="ident">get_descriptor_for_keychain</span>(
+ <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="ident">keychain</span>: <span class="ident">KeychainKind</span>,
+ ) <span class="op">-</span><span class="op">></span> (<span class="kw-2">&</span><span class="ident">ExtendedDescriptor</span>, <span class="ident">KeychainKind</span>) {
+ <span class="kw">match</span> <span class="ident">keychain</span> {
+ <span class="ident">KeychainKind</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">KeychainKind</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">KeychainKind</span>::<span class="ident">External</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">keychain</span>, <span class="ident">child</span>)<span class="op">|</span> (<span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">keychain</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="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">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>);
+
+ <span class="kw">let</span> (<span class="ident">desc</span>, <span class="ident">keychain</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">KeychainKind</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">keychain</span>)<span class="question-mark">?</span>;
+
+ <span class="prelude-val">Ok</span>(<span class="ident">desc</span>
+ .<span class="ident">derive</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">script_pubkey</span>(<span class="ident">deriv_ctx</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">keychain</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">keychain</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">keychain</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">keychain</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">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">index</span>)<span class="question-mark">?</span>)
+ .<span class="ident">script_pubkey</span>(<span class="ident">deriv_ctx</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">keychain</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">keychain</span>: <span class="ident">KeychainKind</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">keychain</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">keychain</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="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">i</span>)<span class="question-mark">?</span>)
+ .<span class="ident">script_pubkey</span>(<span class="ident">deriv_ctx</span>),
+ <span class="ident">keychain</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="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="ident">usize</span>)<span class="op">></span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">deriv_ctx</span> <span class="op">=</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">utxo</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">keychain</span> <span class="op">=</span> <span class="ident">utxo</span>.<span class="ident">keychain</span>;
+ (
+ <span class="ident">utxo</span>,
+ <span class="self">self</span>.<span class="ident">get_descriptor_for_keychain</span>(<span class="ident">keychain</span>)
+ .<span class="number">0</span>
+ .<span class="ident">max_satisfaction_weight</span>(<span class="ident">deriv_ctx</span>)
+ .<span class="ident">unwrap</span>(),
+ )
+ })
+ .<span class="ident">collect</span>())
+ }
+
+ <span class="doccomment">/// Given the options returns the list of utxos that must be used to form the</span>
+ <span class="doccomment">/// transaction and any further that may be used if needed.</span>
+ <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">clippy</span>::<span class="ident">type_complexity</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">preselect_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">unspendable</span>: <span class="kw-2">&</span><span class="ident">HashSet</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>,
+ <span class="ident">manually_selected</span>: <span class="kw-2">&</span>[<span class="ident">OutPoint</span>],
+ <span class="ident">must_use_all_available</span>: <span class="ident">bool</span>,
+ <span class="ident">manual_only</span>: <span class="ident">bool</span>,
+ <span class="ident">must_only_use_confirmed_tx</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="ident">usize</span>)<span class="op">></span>, <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">UTXO</span>, <span class="ident">usize</span>)<span class="op">></span>), <span class="ident">Error</span><span class="op">></span> {
+ <span class="comment">// must_spend <- manually selected utxos</span>
+ <span class="comment">// may_spend <- all other available utxos</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">may_spend</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_available_utxos</span>()<span class="question-mark">?</span>;
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">must_spend</span> <span class="op">=</span> {
+ <span class="kw">let</span> <span class="ident">must_spend_idx</span> <span class="op">=</span> <span class="ident">manually_selected</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">manually_selected</span><span class="op">|</span> {
+ <span class="ident">may_spend</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">position</span>(<span class="op">|</span><span class="ident">available</span><span class="op">|</span> <span class="ident">available</span>.<span class="number">0</span>.<span class="ident">outpoint</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">manually_selected</span>)
+ .<span class="ident">ok_or</span>(<span class="ident">Error</span>::<span class="ident">UnknownUTXO</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">must_spend_idx</span>
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">may_spend</span>.<span class="ident">remove</span>(<span class="ident">i</span>))
+ .<span class="ident">collect</span>()
+ };
+
+ <span class="comment">// NOTE: we are intentionally ignoring `unspendable` here. i.e manual</span>
+ <span class="comment">// selection overrides unspendable.</span>
+ <span class="kw">if</span> <span class="ident">manual_only</span> {
+ <span class="kw">return</span> <span class="prelude-val">Ok</span>((<span class="ident">must_spend</span>, <span class="macro">vec</span><span class="macro">!</span>[]));
+ }
+
+ <span class="kw">let</span> <span class="ident">satisfies_confirmed</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">must_only_use_confirmed_tx</span> {
+ <span class="bool-val">true</span> <span class="op">=</span><span class="op">></span> {
+ <span class="kw">let</span> <span class="ident">database</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">database</span>.<span class="ident">borrow_mut</span>();
+ <span class="ident">may_spend</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="ident">database</span>
+ .<span class="ident">get_tx</span>(<span class="kw-2">&</span><span class="ident">u</span>.<span class="number">0</span>.<span class="ident">outpoint</span>.<span class="ident">txid</span>, <span class="bool-val">true</span>)
+ .<span class="ident">map</span>(<span class="op">|</span><span class="ident">tx</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">tx</span> {
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</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="ident">height</span>.<span class="ident">is_some</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="bool-val">false</span> <span class="op">=</span><span class="op">></span> <span class="macro">vec</span><span class="macro">!</span>[<span class="bool-val">true</span>; <span class="ident">may_spend</span>.<span class="ident">len</span>()],
+ };
+
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">i</span> <span class="op">=</span> <span class="number">0</span>;
+ <span class="ident">may_spend</span>.<span class="ident">retain</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> {
+ <span class="kw">let</span> <span class="ident">retain</span> <span class="op">=</span> <span class="ident">change_policy</span>.<span class="ident">is_satisfied_by</span>(<span class="kw-2">&</span><span class="ident">u</span>.<span class="number">0</span>)
+ <span class="op">&&</span> <span class="op">!</span><span class="ident">unspendable</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">u</span>.<span class="number">0</span>.<span class="ident">outpoint</span>)
+ <span class="op">&&</span> <span class="ident">satisfies_confirmed</span>[<span class="ident">i</span>];
+ <span class="ident">i</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
+ <span class="ident">retain</span>
+ });
+
+ <span class="kw">if</span> <span class="ident">must_use_all_available</span> {
+ <span class="ident">must_spend</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">may_spend</span>);
+ }
+
+ <span class="prelude-val">Ok</span>((<span class="ident">must_spend</span>, <span class="ident">may_spend</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="ident">D</span><span class="op">></span>,
+ <span class="ident">Ctx</span>: <span class="ident">TxBuilderContext</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">selected</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">UTXO</span><span class="op">></span>,
+ <span class="ident">builder</span>: <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">Cs</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="ident">PSBT</span>, <span class="ident">Error</span><span class="op">></span> {
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">serialize</span>::<span class="ident">Serialize</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="kw">if</span> <span class="ident">builder</span>.<span class="ident">add_global_xpubs</span> {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">all_xpubs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">descriptor</span>.<span class="ident">get_extended_keys</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="ident">all_xpubs</span>.<span class="ident">extend</span>(<span class="ident">change_descriptor</span>.<span class="ident">get_extended_keys</span>()<span class="question-mark">?</span>);
+ }
+
+ <span class="kw">for</span> <span class="ident">xpub</span> <span class="kw">in</span> <span class="ident">all_xpubs</span> {
+ <span class="kw">let</span> <span class="ident">serialized_xpub</span> <span class="op">=</span> <span class="ident">base58</span>::<span class="ident">from_check</span>(<span class="kw-2">&</span><span class="ident">xpub</span>.<span class="ident">xkey</span>.<span class="ident">to_string</span>())
+ .<span class="ident">expect</span>(<span class="string">"Internal serialization error"</span>);
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">PSBTKey</span> {
+ <span class="ident">type_value</span>: <span class="number">0x01</span>,
+ <span class="ident">key</span>: <span class="ident">serialized_xpub</span>,
+ };
+
+ <span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">xpub</span>.<span class="ident">origin</span> {
+ <span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">></span> <span class="ident">origin</span>,
+ <span class="prelude-val">None</span> <span class="kw">if</span> <span class="ident">xpub</span>.<span class="ident">xkey</span>.<span class="ident">depth</span> <span class="op">=</span><span class="op">=</span> <span class="number">0</span> <span class="op">=</span><span class="op">></span> {
+ (<span class="ident">xpub</span>.<span class="ident">root_fingerprint</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>), <span class="macro">vec</span><span class="macro">!</span>[].<span class="ident">into</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">Error</span>::<span class="ident">MissingKeyOrigin</span>(<span class="ident">xpub</span>.<span class="ident">xkey</span>.<span class="ident">to_string</span>())),
+ };
+
+ <span class="ident">psbt</span>.<span class="ident">global</span>.<span class="ident">unknown</span>.<span class="ident">insert</span>(<span class="ident">key</span>, <span class="ident">origin</span>.<span class="ident">serialize</span>());
+ }
+ }
+
+ <span class="kw">let</span> <span class="ident">lookup_output</span> <span class="op">=</span> <span class="ident">selected</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">utxo</span>.<span class="ident">outpoint</span>, <span class="ident">utxo</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="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">utxo</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">lookup_output</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">utxo</span>) <span class="op">=</span><span class="op">></span> <span class="ident">utxo</span>,
+ <span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="kw">continue</span>,
+ };
+
+ <span class="comment">// Only set it if the builder has a custom one, otherwise leave blank which defaults to</span>
+ <span class="comment">// SIGHASH_ALL</span>
+ <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">sighash_type</span>) <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">sighash</span> {
+ <span class="ident">psbt_input</span>.<span class="ident">sighash_type</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">sighash_type</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">keychain</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">utxo</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">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_keychain</span>(<span class="ident">keychain</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>)<span class="question-mark">?</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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-2">&</span><span class="self">self</span>.<span class="ident">secp</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">keychain</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_keychain</span>(<span class="ident">keychain</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</span>)<span class="question-mark">?</span>;
+ <span class="kw">if</span> <span class="ident">builder</span>.<span class="ident">include_output_redeem_witness_script</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="ident">ChildNumber</span>::<span class="ident">from_normal_idx</span>(<span class="ident">child</span>)<span class="question-mark">?</span>);
+ <span class="ident">psbt_output</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-2">&</span><span class="self">self</span>.<span class="ident">secp</span>);
+ <span class="ident">psbt_output</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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">keychain</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">keychain</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_keychain</span>(<span class="ident">keychain</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="kw-2">&</span><span class="self">self</span>.<span class="ident">secp</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="op"><</span><span class="ident">E</span>: <span class="ident">ToWalletDescriptor</span><span class="op">></span>(
+ <span class="ident">descriptor</span>: <span class="ident">E</span>,
+ <span class="ident">change_descriptor</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">E</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">KeychainKind</span>::<span class="ident">External</span>, <span class="ident">max_address</span>.<span class="ident">saturating_sub</span>(<span class="number">1</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">KeychainKind</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">KeychainKind</span>::<span class="ident">Internal</span>, <span class="ident">max_address</span>.<span class="ident">saturating_sub</span>(<span class="number">1</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">KeychainKind</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">/// Get the Bitcoin network the wallet is using.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">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">/// 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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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">KeychainKind</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_a_or_b_plus_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">// or(pk(Alice),and(pk(Bob),older(144)))</span>
+ <span class="string">"wsh(or_d(pk(cRjo6jqfVNP33HhSS76UhXETZsGTZYx8FMFvR9kpbtCSV1PmdZdu),and_v(v:pk(cMnkdebixpXMPfkcNEjjGin7s94hiehAH4mLbYkZoh9KSiNNmqC8),older(144))))"</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">"NoRecipients"</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">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">"NoUtxosSelected"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_manually_selected_empty_utxos</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">manually_selected_only</span>()
+ .<span class="ident">utxos</span>(<span class="macro">vec</span><span class="macro">!</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="comment">// When CSV is enabled it takes precedence over the rbf value (unless forced by the user).</span>
+ <span class="comment">// It will be set to the OP_CSV value, in this case 6</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="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` given a required OP_CSV of `6`"</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="kw">fn</span> <span class="ident">test_create_tx_single_recipient_drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">25_000</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">25_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">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_absolute_fee</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</span>()
+ .<span class="ident">fee_absolute</span>(<span class="number">100</span>),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">100</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_absolute_zero_fee</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</span>()
+ .<span class="ident">fee_absolute</span>(<span class="number">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">fees</span>, <span class="number">0</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="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_absolute_high_fee</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</span>()
+ .<span class="ident">fee_absolute</span>(<span class="number">60_000</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_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_single_recipient_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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</span>()
+ .<span class="ident">fee_rate</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">None</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']tpubDEnoLuPdBep9bzw5LoGYpsxUQYheRQ9gcgrJhJEcdKFB9cWQRyYmkCyRoTqeD4tJYiVVgt6A3rN6rWn9RYhR9sBsGxji29LYWHuKKbdb1ev/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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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']tpubDEnoLuPdBep9bzw5LoGYpsxUQYheRQ9gcgrJhJEcdKFB9cWQRyYmkCyRoTqeD4tJYiVVgt6A3rN6rWn9RYhR9sBsGxji29LYWHuKKbdb1ev/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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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_shwpkh_has_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(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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</span>()
+ .<span class="ident">force_non_witness_utxo</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="kw">fn</span> <span class="ident">test_create_tx_add_utxo</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">small_output_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="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">add_utxo</span>(
+ <span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">small_output_txid</span>,
+ <span class="ident">vout</span>: <span class="number">0</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="ident">len</span>(),
+ <span class="number">2</span>,
+ <span class="string">"should add an additional input since 25_000 < 30_000"</span>
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">sent</span>, <span class="number">75_000</span>, <span class="string">"total should be sum of both inputs"</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_manually_selected_insufficient</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">small_output_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="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">add_utxo</span>(<span class="ident">OutPoint</span> {
+ <span class="ident">txid</span>: <span class="ident">small_output_txid</span>,
+ <span class="ident">vout</span>: <span class="number">0</span>,
+ })
+ .<span class="ident">manually_selected_only</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">"SpendingPolicyRequired(External)"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_policy_path_required</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_a_or_b_plus_csv</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="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="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_policy_path_no_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_a_or_b_plus_csv</span>());
+
+ <span class="kw">let</span> <span class="ident">external_policy</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">policies</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">root_id</span> <span class="op">=</span> <span class="ident">external_policy</span>.<span class="ident">id</span>;
+ <span class="comment">// child #0 is just the key "A"</span>
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">root_id</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>])].<span class="ident">into_iter</span>().<span class="ident">collect</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">_</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">policy_path</span>(<span class="ident">path</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</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="kw">fn</span> <span class="ident">test_create_tx_policy_path_use_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_a_or_b_plus_csv</span>());
+
+ <span class="kw">let</span> <span class="ident">external_policy</span> <span class="op">=</span> <span class="ident">wallet</span>.<span class="ident">policies</span>(<span class="ident">KeychainKind</span>::<span class="ident">External</span>).<span class="ident">unwrap</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">root_id</span> <span class="op">=</span> <span class="ident">external_policy</span>.<span class="ident">id</span>;
+ <span class="comment">// child #1 is or(pk(B),older(144))</span>
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[(<span class="ident">root_id</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>])].<span class="ident">into_iter</span>().<span class="ident">collect</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">_</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">policy_path</span>(<span class="ident">path</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</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">144</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_global_xpubs_with_origin</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">base58</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">raw</span>::<span class="ident">Key</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([73756c7f/48'/0'/0'/2']tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/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">25_000</span>)]).<span class="ident">add_global_xpubs</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">type_value</span> <span class="op">=</span> <span class="number">0x01</span>;
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">base58</span>::<span class="ident">from_check</span>(<span class="string">"tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">psbt_key</span> <span class="op">=</span> <span class="ident">Key</span> { <span class="ident">type_value</span>, <span class="ident">key</span> };
+
+ <span class="comment">// This key has an explicit origin, so it will be encoded here</span>
+ <span class="kw">let</span> <span class="ident">value_bytes</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">"73756c7f30000080000000800000008002000080"</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">unknown</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">unknown</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">psbt_key</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">value_bytes</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">"MissingKeyOrigin(\"tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3\")"</span>
+ )]</span>
+ <span class="kw">fn</span> <span class="ident">test_create_tx_global_xpubs_origin_missing</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(tpubDCKxNyM3bLgbEX13Mcd8mYxbVg9ajDkWXMh29hMWBurKfVmBfWAM96QVP3zaUcN51HvkZ3ar4VwP82kC8JZhhux8vFQoJintSpVBwpFvyU3/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="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">add_global_xpubs</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_global_xpubs_master_without_origin</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">base58</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">raw</span>::<span class="ident">Key</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(tpubD6NzVbkrYhZ4Y55A58Gv9RSNF5hy84b5AJqYy7sCcjFrkcLpPre8kmgfit6kY1Zs3BLgeypTDBZJM222guPpdz7Cup5yzaMu62u7mYGbwFL/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">25_000</span>)]).<span class="ident">add_global_xpubs</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">type_value</span> <span class="op">=</span> <span class="number">0x01</span>;
+ <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">base58</span>::<span class="ident">from_check</span>(<span class="string">"tpubD6NzVbkrYhZ4Y55A58Gv9RSNF5hy84b5AJqYy7sCcjFrkcLpPre8kmgfit6kY1Zs3BLgeypTDBZJM222guPpdz7Cup5yzaMu62u7mYGbwFL"</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">psbt_key</span> <span class="op">=</span> <span class="ident">Key</span> { <span class="ident">type_value</span>, <span class="ident">key</span> };
+
+ <span class="comment">// This key doesn't have an explicit origin, but it's a master key (depth = 0). So we encode</span>
+ <span class="comment">// its fingerprint directly and an empty path</span>
+ <span class="kw">let</span> <span class="ident">value_bytes</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">"997a323b"</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">unknown</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">unknown</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">psbt_key</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">value_bytes</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="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"FeeTooLow"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_low_abs</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_absolute</span>(<span class="number">10</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">"FeeTooLow"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_zero_abs</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_absolute</span>(<span class="number">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_absolute_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_absolute</span>(<span class="number">200</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="string">"{} > {}"</span>,
+ <span class="ident">details</span>.<span class="ident">fees</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_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">200</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_reduce_single_recipient</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">maintain_single_recipient</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="kw">fn</span> <span class="ident">test_bump_fee_absolute_reduce_single_recipient</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">maintain_single_recipient</span>()
+ .<span class="ident">fee_absolute</span>(<span class="number">300</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_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">300</span>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_drain_wallet</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 so that our wallet has two utxos.</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">outpoint</span> <span class="op">=</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="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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">utxos</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">outpoint</span>])
+ .<span class="ident">manually_selected_only</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="comment">// for the new feerate, it should be enough to reduce the output, but since we specify</span>
+ <span class="comment">// `drain_wallet` we expect to spend everything</span>
+ <span class="kw">let</span> (<span class="kw">_</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">drain_wallet</span>()
+ .<span class="ident">maintain_single_recipient</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="number">75_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">"InsufficientFunds"</span>)]</span>
+ <span class="kw">fn</span> <span class="ident">test_bump_fee_remove_output_manually_selected_only</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 so that our wallet has two utxos. then we manually pick only one of</span>
+ <span class="comment">// them, and make sure that `bump_fee` doesn't try to add more. eventually, it should fail</span>
+ <span class="comment">// because the fee rate is too high and the single utxo isn't enough to create a non-dust</span>
+ <span class="comment">// output</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">outpoint</span> <span class="op">=</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="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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">utxos</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">outpoint</span>])
+ .<span class="ident">manually_selected_only</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">utxos</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">outpoint</span>])
+ .<span class="ident">manually_selected_only</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_absolute_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_absolute</span>(<span class="number">6_000</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_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">6_000</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="comment">// initially make a tx without change by using `set_single_recipient`</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</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">manually_selected_only</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">// now bump the fees without using `maintain_single_recipient`. the wallet should add an</span>
+ <span class="comment">// extra input and a change output, and leave the original output untouched</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_bump_fee_absolute_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_absolute</span>(<span class="number">250</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_eq</span><span class="macro">!</span>(<span class="ident">details</span>.<span class="ident">fees</span>, <span class="number">250</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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_bip44_path</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/44'/0'/0'/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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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_sh_wpkh</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(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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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">new</span>()
+ .<span class="ident">set_single_recipient</span>(<span class="ident">addr</span>.<span class="ident">script_pubkey</span>())
+ .<span class="ident">drain_wallet</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>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_include_output_redeem_witness_script</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(multi(1,cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW,cRjo6jqfVNP33HhSS76UhXETZsGTZYx8FMFvR9kpbtCSV1PmdZdu)))"</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">_</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">include_output_redeem_witness_script</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="comment">// p2sh-p2wsh transaction should contain both witness and redeem scripts</span>
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">psbt</span>
+ .<span class="ident">outputs</span>
+ .<span class="ident">iter</span>()
+ .<span class="ident">any</span>(<span class="op">|</span><span class="ident">output</span><span class="op">|</span> <span class="ident">output</span>.<span class="ident">redeem_script</span>.<span class="ident">is_some</span>() <span class="op">&&</span> <span class="ident">output</span>.<span class="ident">witness_script</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_signing_only_one_of_multiple_inputs</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="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">45_000</span>)])
+ .<span class="ident">include_output_redeem_witness_script</span>(),
+ )
+ .<span class="ident">unwrap</span>();
+
+ <span class="comment">// add another input to the psbt that is at least passable.</span>
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dud_input</span> <span class="op">=</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">psbt</span>::<span class="ident">Input</span>::<span class="ident">default</span>();
+ <span class="ident">dud_input</span>.<span class="ident">witness_utxo</span> <span class="op">=</span> <span class="prelude-val">Some</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">miniscript</span>::<span class="ident">Descriptor</span>::<span class="op"><</span><span class="ident">bitcoin</span>::<span class="ident">PublicKey</span><span class="op">></span>::<span class="ident">from_str</span>(
+ <span class="string">"wpkh(025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357)"</span>,
+ )
+ .<span class="ident">unwrap</span>()
+ .<span class="ident">script_pubkey</span>(<span class="ident">miniscript</span>::<span class="ident">NullCtx</span>),
+ });
+ <span class="ident">psbt</span>.<span class="ident">inputs</span>.<span class="ident">push</span>(<span class="ident">dud_input</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">push</span>(<span class="ident">bitcoin</span>::<span class="ident">TxIn</span>::<span class="ident">default</span>());
+ <span class="kw">let</span> (<span class="ident">psbt</span>, <span class="ident">is_final</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</span><span class="macro">!</span>(
+ <span class="op">!</span><span class="ident">is_final</span>,
+ <span class="string">"shouldn't be final since we can't sign one of the inputs"</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">final_script_witness</span>.<span class="ident">is_some</span>(),
+ <span class="string">"should finalized input it signed"</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 of the Rust file `src/wallet/signer.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>signer.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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::secp256k1::{Secp256k1, All};</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">//! _secp: &Secp256k1<All>,</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">//! KeychainKind::External,</span>
+<span class="doccomment">//! Fingerprint::from_str("e30f11b8").unwrap().into(),</span>
+<span class="doccomment">//! SignerOrdering(200),</span>
+<span class="doccomment">//! Arc::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">Script</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">DescriptorSecretKey</span>, <span class="ident">DescriptorSinglePriv</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">super</span>::<span class="ident">utils</span>::<span class="ident">SecpCtx</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">Ord</span>, <span class="ident">PartialOrd</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="doccomment">/// Bitcoin HASH160 (RIPEMD160 after SHA256) hash of an ECDSA public key</span>
+ <span class="ident">PkHash</span>(<span class="ident">hash160</span>::<span class="ident">Hash</span>),
+ <span class="doccomment">/// The fingerprint of a BIP32 extended key</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="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="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="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="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 private key in use has the right fingerprint but derives differently than expected</span>
+ <span class="ident">InvalidKey</span>,
+ <span class="doccomment">/// The user canceled the operation</span>
+ <span class="ident">UserCanceled</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="op">+</span> <span class="ident">Send</span> <span class="op">+</span> <span class="ident">Sync</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">public_key</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="ident">pk</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="kw">if</span> <span class="self">self</span>.<span class="ident">matches</span>(<span class="kw-2">&</span>(<span class="ident">fingerprint</span>, <span class="ident">path</span>.<span class="ident">clone</span>()), <span class="kw-2">&</span><span class="ident">secp</span>).<span class="ident">is_some</span>() {
+ <span class="prelude-val">Some</span>((<span class="ident">pk</span>, <span class="ident">path</span>))
+ } <span class="kw">else</span> {
+ <span class="prelude-val">None</span>
+ }
+ })
+ .<span class="ident">next</span>()
+ {
+ <span class="prelude-val">Some</span>((<span class="ident">pk</span>, <span class="ident">full_path</span>)) <span class="op">=</span><span class="op">></span> (<span class="ident">pk</span>, <span class="ident">full_path</span>.<span class="ident">clone</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="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">secp</span>, <span class="kw-2">&</span><span class="ident">deriv_path</span>).<span class="ident">unwrap</span>();
+ <span class="kw">if</span> <span class="kw-2">&</span><span class="ident">derived_key</span>.<span class="ident">private_key</span>.<span class="ident">public_key</span>(<span class="kw-2">&</span><span class="ident">secp</span>) <span class="op">!</span><span class="op">=</span> <span class="ident">public_key</span> {
+ <span class="prelude-val">Err</span>(<span class="ident">SignerError</span>::<span class="ident">InvalidKey</span>)
+ } <span class="kw">else</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="ident">secp</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">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">secp</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">secp</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">SinglePriv</span>(<span class="ident">DescriptorSinglePriv</span> {
+ <span class="ident">key</span>: <span class="kw-2">*</span><span class="self">self</span>,
+ <span class="ident">origin</span>: <span class="prelude-val">None</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="ident">id</span>: <span class="ident">SignerId</span>,
+ <span class="ident">ordering</span>: <span class="ident">SignerOrdering</span>,
+}
+
+<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span>(<span class="ident">SignerId</span>, <span class="ident">SignerOrdering</span>)<span class="op">></span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span> {
+ <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">tuple</span>: (<span class="ident">SignerId</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="ident">BTreeMap</span><span class="op"><</span><span class="ident">SignersContainerKey</span>, <span class="ident">Arc</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">Signer</span><span class="op">></span><span class="op">></span>);
+
+<span class="kw">impl</span> <span class="ident">SignersContainer</span> {
+ <span class="doccomment">/// Create a map of public keys to secret keys</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="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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">secp</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="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="kw">let</span> <span class="ident">secp</span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</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">SinglePriv</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">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">private_key</span>.<span class="ident">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="kw-2">&</span><span class="ident">secp</span>)),
+ <span class="ident">SignerOrdering</span>::<span class="ident">default</span>(),
+ <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">xprv</span>),
+ ),
+ };
+ }
+
+ <span class="ident">container</span>
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">SignersContainer</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 previously 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="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">dyn</span> <span class="ident">Signer</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">dyn</span> <span class="ident">Signer</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="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">dyn</span> <span class="ident">Signer</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="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">dyn</span> <span class="ident">Signer</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="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">dyn</span> <span class="ident">Signer</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">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="ident">usize</span>::<span class="ident">MAX</span>)).<span class="ident">into</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">id</span> <span class="op">=</span><span class="op">=</span> <span class="ident">id</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">next</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">unwrap_or</span>(<span class="ident">SigHashType</span>::<span class="ident">All</span>);
+ <span class="kw">let</span> <span class="ident">script</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">psbt_input</span>.<span class="ident">redeem_script</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="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">fn</span> <span class="ident">p2wpkh_script_code</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">Script</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">script</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">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">unwrap_or</span>(<span class="ident">SigHashType</span>::<span class="ident">All</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="ident">psbt_input</span>.<span class="ident">witness_script</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="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">p2wpkh_script_code</span>(<span class="kw-2">&</span><span class="ident">witness_utxo</span>.<span class="ident">script_pubkey</span>)
+ } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">psbt_input</span>
+ .<span class="ident">redeem_script</span>
+ .<span class="ident">as_ref</span>()
+ .<span class="ident">map</span>(<span class="ident">Script</span>::<span class="ident">is_v0_p2wpkh</span>)
+ .<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
+ {
+ <span class="ident">p2wpkh_script_code</span>(<span class="kw-2">&</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="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="ident">PartialOrd</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</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="ident">Ord</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</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="ident">then</span>(<span class="self">self</span>.<span class="ident">id</span>.<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">other</span>.<span class="ident">id</span>))
+ }
+}
+
+<span class="kw">impl</span> <span class="ident">PartialEq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</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">id</span> <span class="op">=</span><span class="op">=</span> <span class="ident">other</span>.<span class="ident">id</span> <span class="op">&&</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="ident">Eq</span> <span class="kw">for</span> <span class="ident">SignersContainerKey</span> {}
+
+<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
+<span class="kw">mod</span> <span class="ident">signers_container_tests</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">descriptor</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">descriptor</span>::<span class="ident">ToWalletDescriptor</span>;
+ <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">keys</span>::{<span class="ident">DescriptorKey</span>, <span class="ident">ToDescriptorKey</span>};
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">secp256k1</span>::<span class="ident">All</span>;
+ <span class="kw">use</span> <span class="ident">bitcoin</span>::<span class="ident">util</span>::<span class="ident">bip32</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">use</span> <span class="ident">bitcoin</span>::<span class="ident">Network</span>;
+ <span class="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">ScriptContext</span>;
+ <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
+
+ <span class="comment">// Signers added with the same ordering (like `Ordering::default`) created from `KeyMap`</span>
+ <span class="comment">// should be preserved and not overwritten.</span>
+ <span class="comment">// This happens usually when a set of signers is created from a descriptor with private keys.</span>
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">signers_with_same_ordering</span>() {
+ <span class="kw">let</span> (<span class="ident">prvkey1</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV0_STR</span>);
+ <span class="kw">let</span> (<span class="ident">prvkey2</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">setup_keys</span>(<span class="ident">TPRV1_STR</span>);
+ <span class="kw">let</span> <span class="ident">desc</span> <span class="op">=</span> <span class="macro">descriptor</span><span class="macro">!</span>(<span class="ident">sh</span>(<span class="ident">multi</span> <span class="number">2</span>, <span class="ident">prvkey1</span>, <span class="ident">prvkey2</span>)).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> (<span class="kw">_</span>, <span class="ident">keymap</span>) <span class="op">=</span> <span class="ident">desc</span>.<span class="ident">to_wallet_descriptor</span>(<span class="ident">Network</span>::<span class="ident">Testnet</span>).<span class="ident">unwrap</span>();
+
+ <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">SignersContainer</span>::<span class="ident">from</span>(<span class="ident">keymap</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">ids</span>().<span class="ident">len</span>(), <span class="number">2</span>);
+
+ <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">signers</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">signers</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">signers_sorted_by_ordering</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">SignersContainer</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">signer1</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+ <span class="kw">let</span> <span class="ident">signer2</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+ <span class="kw">let</span> <span class="ident">signer3</span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(
+ <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"cafe"</span>[..].<span class="ident">into</span>()),
+ <span class="ident">SignerOrdering</span>(<span class="number">1</span>),
+ <span class="ident">signer1</span>.<span class="ident">clone</span>(),
+ );
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(
+ <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"babe"</span>[..].<span class="ident">into</span>()),
+ <span class="ident">SignerOrdering</span>(<span class="number">2</span>),
+ <span class="ident">signer2</span>.<span class="ident">clone</span>(),
+ );
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(
+ <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"feed"</span>[..].<span class="ident">into</span>()),
+ <span class="ident">SignerOrdering</span>(<span class="number">3</span>),
+ <span class="ident">signer3</span>.<span class="ident">clone</span>(),
+ );
+
+ <span class="comment">// Check that signers are sorted from lowest to highest ordering</span>
+ <span class="kw">let</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">signers</span>.<span class="ident">signers</span>();
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signers</span>[<span class="number">0</span>]), <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer1</span>));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signers</span>[<span class="number">1</span>]), <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer2</span>));
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signers</span>[<span class="number">2</span>]), <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer3</span>));
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">find_signer_by_id</span>() {
+ <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">signers</span> <span class="op">=</span> <span class="ident">SignersContainer</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">signer1</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">Signer</span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+ <span class="kw">let</span> <span class="ident">signer2</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">Signer</span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+ <span class="kw">let</span> <span class="ident">signer3</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">Signer</span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+ <span class="kw">let</span> <span class="ident">signer4</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">Signer</span><span class="op">></span> <span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">new</span>(<span class="ident">DummySigner</span>);
+
+ <span class="kw">let</span> <span class="ident">id1</span> <span class="op">=</span> <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"cafe"</span>[..].<span class="ident">into</span>());
+ <span class="kw">let</span> <span class="ident">id2</span> <span class="op">=</span> <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"babe"</span>[..].<span class="ident">into</span>());
+ <span class="kw">let</span> <span class="ident">id3</span> <span class="op">=</span> <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"feed"</span>[..].<span class="ident">into</span>());
+ <span class="kw">let</span> <span class="ident">id_nonexistent</span> <span class="op">=</span> <span class="ident">SignerId</span>::<span class="ident">Fingerprint</span>(<span class="string">b"fefe"</span>[..].<span class="ident">into</span>());
+
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id1</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">1</span>), <span class="ident">signer1</span>.<span class="ident">clone</span>());
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id2</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">2</span>), <span class="ident">signer2</span>.<span class="ident">clone</span>());
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id3</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">3</span>), <span class="ident">signer3</span>.<span class="ident">clone</span>());
+
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">id1</span>), <span class="prelude-val">Some</span>(<span class="ident">signer</span>) <span class="kw">if</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer1</span>) <span class="op">=</span><span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signer</span>))
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">id2</span>), <span class="prelude-val">Some</span>(<span class="ident">signer</span>) <span class="kw">if</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer2</span>) <span class="op">=</span><span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signer</span>))
+ );
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">id3</span>.<span class="ident">clone</span>()), <span class="prelude-val">Some</span>(<span class="ident">signer</span>) <span class="kw">if</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer3</span>) <span class="op">=</span><span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signer</span>))
+ );
+
+ <span class="comment">// The `signer4` has the same ID as `signer3` but lower ordering.</span>
+ <span class="comment">// It should be found by `id3` instead of `signer3`.</span>
+ <span class="ident">signers</span>.<span class="ident">add_external</span>(<span class="ident">id3</span>.<span class="ident">clone</span>(), <span class="ident">SignerOrdering</span>(<span class="number">2</span>), <span class="ident">signer4</span>.<span class="ident">clone</span>());
+ <span class="macro">assert</span><span class="macro">!</span>(
+ <span class="macro">matches</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">id3</span>), <span class="prelude-val">Some</span>(<span class="ident">signer</span>) <span class="kw">if</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="kw-2">&</span><span class="ident">signer4</span>) <span class="op">=</span><span class="op">=</span> <span class="ident">Arc</span>::<span class="ident">as_ptr</span>(<span class="ident">signer</span>))
+ );
+
+ <span class="comment">// Can't find anything with ID that doesn't exist</span>
+ <span class="macro">assert</span><span class="macro">!</span>(<span class="macro">matches</span><span class="macro">!</span>(<span class="ident">signers</span>.<span class="ident">find</span>(<span class="ident">id_nonexistent</span>), <span class="prelude-val">None</span>));
+ }
+
+ <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+ <span class="kw">struct</span> <span class="ident">DummySigner</span>;
+ <span class="kw">impl</span> <span class="ident">Signer</span> <span class="kw">for</span> <span class="ident">DummySigner</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">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="ident">_secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</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="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">true</span>
+ }
+ }
+
+ <span class="kw">const</span> <span class="ident">TPRV0_STR</span>:<span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"tprv8ZgxMBicQKsPdZXrcHNLf5JAJWFAoJ2TrstMRdSKtEggz6PddbuSkvHKM9oKJyFgZV1B7rw8oChspxyYbtmEXYyg1AjfWbL3ho3XHDpHRZf"</span>;
+ <span class="kw">const</span> <span class="ident">TPRV1_STR</span>:<span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N"</span>;
+
+ <span class="kw">const</span> <span class="ident">PATH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"m/44'/1'/0'/0"</span>;
+
+ <span class="kw">fn</span> <span class="ident">setup_keys</span><span class="op"><</span><span class="ident">Ctx</span>: <span class="ident">ScriptContext</span><span class="op">></span>(
+ <span class="ident">tprv</span>: <span class="kw-2">&</span><span class="ident">str</span>,
+ ) <span class="op">-</span><span class="op">></span> (<span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">DescriptorKey</span><span class="op"><</span><span class="ident">Ctx</span><span class="op">></span>, <span class="ident">Fingerprint</span>) {
+ <span class="kw">let</span> <span class="ident">secp</span>: <span class="ident">Secp256k1</span><span class="op"><</span><span class="ident">All</span><span class="op">></span> <span class="op">=</span> <span class="ident">Secp256k1</span>::<span class="ident">new</span>();
+ <span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">DerivationPath</span>::<span class="ident">from_str</span>(<span class="ident">PATH</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tprv</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPrivKey</span>::<span class="ident">from_str</span>(<span class="ident">tprv</span>).<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">tpub</span> <span class="op">=</span> <span class="ident">bip32</span>::<span class="ident">ExtendedPubKey</span>::<span class="ident">from_private</span>(<span class="kw-2">&</span><span class="ident">secp</span>, <span class="kw-2">&</span><span class="ident">tprv</span>);
+ <span class="kw">let</span> <span class="ident">fingerprint</span> <span class="op">=</span> <span class="ident">tprv</span>.<span class="ident">fingerprint</span>(<span class="kw-2">&</span><span class="ident">secp</span>);
+ <span class="kw">let</span> <span class="ident">prvkey</span> <span class="op">=</span> (<span class="ident">tprv</span>, <span class="ident">path</span>.<span class="ident">clone</span>()).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+ <span class="kw">let</span> <span class="ident">pubkey</span> <span class="op">=</span> (<span class="ident">tpub</span>, <span class="ident">path</span>).<span class="ident">to_descriptor_key</span>().<span class="ident">unwrap</span>();
+
+ (<span class="ident">prvkey</span>, <span class="ident">pubkey</span>, <span class="ident">fingerprint</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 of the Rust file `src/wallet/time.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>time.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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 of the Rust file `src/wallet/tx_builder.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>tx_builder.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">//! # use bdk::wallet::tx_builder::CreateTx;</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">//! # let builder: TxBuilder<bdk::database::MemoryDatabase, _, CreateTx> = builder;</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">collections</span>::<span class="ident">HashSet</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">std</span>::<span class="ident">marker</span>::<span class="ident">PhantomData</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">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">FeeRate</span>, <span class="ident">KeychainKind</span>, <span class="ident">UTXO</span>};
+
+<span class="doccomment">/// Context in which the [`TxBuilder`] is valid</span>
+<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">TxBuilderContext</span>: <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="op">+</span> <span class="ident">Default</span> <span class="op">+</span> <span class="ident">Clone</span> {}
+
+<span class="doccomment">/// [`Wallet::create_tx`](super::Wallet::create_tx) context</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">CreateTx</span>;
+<span class="kw">impl</span> <span class="ident">TxBuilderContext</span> <span class="kw">for</span> <span class="ident">CreateTx</span> {}
+
+<span class="doccomment">/// [`Wallet::bump_fee`](super::Wallet::bump_fee) context</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">BumpFee</span>;
+<span class="kw">impl</span> <span class="ident">TxBuilderContext</span> <span class="kw">for</span> <span class="ident">BumpFee</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>
+<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span>, <span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">TxBuilderContext</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">drain_wallet</span>: <span class="ident">bool</span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">single_recipient</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Script</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">fee_policy</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">FeePolicy</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">internal_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">external_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="ident">Vec</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">unspendable</span>: <span class="ident">HashSet</span><span class="op"><</span><span class="ident">OutPoint</span><span class="op">></span>,
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">manually_selected_only</span>: <span class="ident">bool</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">RBFValue</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">add_global_xpubs</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">pub</span>(<span class="kw">crate</span>) <span class="ident">include_output_redeem_witness_script</span>: <span class="ident">bool</span>,
+
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span><span class="op"><</span>(<span class="ident">D</span>, <span class="ident">Ctx</span>)<span class="op">></span>,
+}
+
+<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">enum</span> <span class="ident">FeePolicy</span> {
+ <span class="ident">FeeRate</span>(<span class="ident">FeeRate</span>),
+ <span class="ident">FeeAmount</span>(<span class="ident">u64</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">FeePolicy</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">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">FeeRate</span>::<span class="ident">default_min_relay_fee</span>())
+ }
+}
+
+<span class="comment">// Unfortunately derive doesn't work with `PhantomData`: https://github.com/rust-lang/rust/issues/26925</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span>, <span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">TxBuilderContext</span><span class="op">></span> <span class="ident">Default</span>
+ <span class="kw">for</span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">Cs</span>, <span class="ident">Ctx</span><span class="op">></span>
+<span class="kw">where</span>
+ <span class="ident">Cs</span>: <span class="ident">Default</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">TxBuilder</span> {
+ <span class="ident">recipients</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">drain_wallet</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">single_recipient</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">fee_policy</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">internal_policy_path</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">external_policy_path</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">utxos</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">unspendable</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">manually_selected_only</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">sighash</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">ordering</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">locktime</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">rbf</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">version</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">change_policy</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">force_non_witness_utxo</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">add_global_xpubs</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">coin_selection</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+ <span class="ident">include_output_redeem_witness_script</span>: <span class="ident">Default</span>::<span class="ident">default</span>(),
+
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ }
+ }
+}
+
+<span class="comment">// methods supported by both contexts, but only for `DefaultCoinSelectionAlgorithm`</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span>, <span class="ident">Ctx</span>: <span class="ident">TxBuilderContext</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">DefaultCoinSelectionAlgorithm</span>, <span class="ident">Ctx</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="comment">// methods supported by both contexts, for any CoinSelectionAlgorithm</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span>, <span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>, <span class="ident">Ctx</span>: <span class="ident">TxBuilderContext</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">Cs</span>, <span class="ident">Ctx</span><span class="op">></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_policy</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">FeePolicy</span>::<span class="ident">FeeRate</span>(<span class="ident">fee_rate</span>));
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Set an absolute fee</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">fee_absolute</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fee_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">fee_policy</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">FeePolicy</span>::<span class="ident">FeeAmount</span>(<span class="ident">fee_amount</span>));
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Set the policy path to use while creating the transaction for a given keychain.</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="doccomment">///</span>
+ <span class="doccomment">/// ## Example</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// An example of when the policy path is needed is the following descriptor:</span>
+ <span class="doccomment">/// `wsh(thresh(2,pk(A),sj:and_v(v:pk(B),n:older(6)),snj:and_v(v:pk(C),after(630000))))`,</span>
+ <span class="doccomment">/// derived from the miniscript policy `thresh(2,pk(A),and(pk(B),older(6)),and(pk(C),after(630000)))`.</span>
+ <span class="doccomment">/// It declares three descriptor fragments, and at the top level it uses `thresh()` to</span>
+ <span class="doccomment">/// ensure that at least two of them are satisfied. The individual fragments are:</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// 1. `pk(A)`</span>
+ <span class="doccomment">/// 2. `and(pk(B),older(6))`</span>
+ <span class="doccomment">/// 3. `and(pk(C),after(630000))`</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// When those conditions are combined in pairs, it's clear that the transaction needs to be created</span>
+ <span class="doccomment">/// differently depending on how the user intends to satisfy the policy afterwards:</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// * If fragments `1` and `2` are used, the transaction will need to use a specific</span>
+ <span class="doccomment">/// `n_sequence` in order to spend an `OP_CSV` branch.</span>
+ <span class="doccomment">/// * If fragments `1` and `3` are used, the transaction will need to use a specific `locktime`</span>
+ <span class="doccomment">/// in order to spend an `OP_CLTV` branch.</span>
+ <span class="doccomment">/// * If fragments `2` and `3` are used, the transaction will need both.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// When the spending policy is represented as a tree (see</span>
+ <span class="doccomment">/// [`Wallet::policies`](super::Wallet::policies)), every node</span>
+ <span class="doccomment">/// is assigned a unique identifier that can be used in the policy path to specify which of</span>
+ <span class="doccomment">/// the node's children the user intends to satisfy: for instance, assuming the `thresh()`</span>
+ <span class="doccomment">/// root node of this example has an id of `aabbccdd`, the policy path map would look like:</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// `{ "aabbccdd" => [0, 1] }`</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// where the key is the node's id, and the value is a list of the children that should be</span>
+ <span class="doccomment">/// used, in no particular order.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If a particularly complex descriptor has multiple ambiguous thresholds in its structure,</span>
+ <span class="doccomment">/// multiple entries can be added to the map, one for each node that requires an explicit path.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// ```</span>
+ <span class="doccomment">/// # use std::str::FromStr;</span>
+ <span class="doccomment">/// # use std::collections::BTreeMap;</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">/// let mut path = BTreeMap::new();</span>
+ <span class="doccomment">/// path.insert("aabbccdd".to_string(), vec![0, 1]);</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// let builder = TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])</span>
+ <span class="doccomment">/// .policy_path(path, KeychainKind::External);</span>
+ <span class="doccomment">/// # let builder: TxBuilder<bdk::database::MemoryDatabase, _, _> = builder;</span>
+ <span class="doccomment">/// ```</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="ident">keychain</span>: <span class="ident">KeychainKind</span>,
+ ) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="kw">let</span> <span class="ident">to_update</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">keychain</span> {
+ <span class="ident">KeychainKind</span>::<span class="ident">Internal</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">internal_policy_path</span>,
+ <span class="ident">KeychainKind</span>::<span class="ident">External</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">external_policy_path</span>,
+ };
+
+ <span class="kw-2">*</span><span class="ident">to_update</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="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">push</span>(<span class="ident">utxo</span>);
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Only spend utxos added by [`add_utxo`] and [`utxos`].</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// The wallet will **not** add additional utxos to the transaction even if they are needed to</span>
+ <span class="doccomment">/// make the transaction valid.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// [`add_utxo`]: Self::add_utxo</span>
+ <span class="doccomment">/// [`utxos`]: Self::utxos</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">manually_selected_only</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">manually_selected_only</span> <span class="op">=</span> <span class="bool-val">true</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="ident">unspendable</span>.<span class="ident">into_iter</span>().<span class="ident">collect</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">insert</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">/// 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">i32</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">/// Fill-in the [`psbt::Output::redeem_script`](bitcoin::util::psbt::Output::redeem_script) and</span>
+ <span class="doccomment">/// [`psbt::Output::witness_script`](bitcoin::util::psbt::Output::witness_script) fields.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This is useful for signers which always require it, like ColdCard hardware wallets.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">include_output_redeem_witness_script</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">include_output_redeem_witness_script</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Fill-in the `PSBT_GLOBAL_XPUB` field with the extended keys contained in both the external</span>
+ <span class="doccomment">/// and internal descriptors</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This is useful for offline signers that take part to a multisig. Some hardware wallets like</span>
+ <span class="doccomment">/// BitBox and ColdCard are known to require this.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_global_xpubs</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">add_global_xpubs</span> <span class="op">=</span> <span class="bool-val">true</span>;
+ <span class="self">self</span>
+ }
+
+ <span class="doccomment">/// Spend all the available inputs. This respects filters like [`TxBuilder::unspendable`] and the change policy.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">drain_wallet</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">drain_wallet</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="ident">D</span><span class="op">></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">D</span>, <span class="ident">P</span>, <span class="ident">Ctx</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">drain_wallet</span>: <span class="self">self</span>.<span class="ident">drain_wallet</span>,
+ <span class="ident">single_recipient</span>: <span class="self">self</span>.<span class="ident">single_recipient</span>,
+ <span class="ident">fee_policy</span>: <span class="self">self</span>.<span class="ident">fee_policy</span>,
+ <span class="ident">internal_policy_path</span>: <span class="self">self</span>.<span class="ident">internal_policy_path</span>,
+ <span class="ident">external_policy_path</span>: <span class="self">self</span>.<span class="ident">external_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">manually_selected_only</span>: <span class="self">self</span>.<span class="ident">manually_selected_only</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">add_global_xpubs</span>: <span class="self">self</span>.<span class="ident">add_global_xpubs</span>,
+ <span class="ident">include_output_redeem_witness_script</span>: <span class="self">self</span>.<span class="ident">include_output_redeem_witness_script</span>,
+ <span class="ident">coin_selection</span>,
+
+ <span class="ident">phantom</span>: <span class="ident">PhantomData</span>,
+ }
+ }
+}
+
+<span class="comment">// methods supported only by create_tx, and only for `DefaultCoinSelectionAlgorithm`</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">DefaultCoinSelectionAlgorithm</span>, <span class="ident">CreateTx</span><span class="op">></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="comment">// methods supported only by create_tx, for any `CoinSelectionAlgorithm`</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span>, <span class="ident">Cs</span>: <span class="ident">CoinSelectionAlgorithm</span><span class="op"><</span><span class="ident">D</span><span class="op">></span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">Cs</span>, <span class="ident">CreateTx</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">/// Set a single recipient that will get all the selected funds minus the fee. No change will</span>
+ <span class="doccomment">/// be created</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// This method overrides any recipient set with [`set_recipients`](Self::set_recipients) or</span>
+ <span class="doccomment">/// [`add_recipient`](Self::add_recipient).</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// It can only be used in conjunction with [`drain_wallet`](Self::drain_wallet) to send the</span>
+ <span class="doccomment">/// entire content of the wallet (minus filters) to a single recipient or with a</span>
+ <span class="doccomment">/// list of manually selected UTXOs by enabling [`manually_selected_only`](Self::manually_selected_only)</span>
+ <span class="doccomment">/// and selecting them with [`utxos`](Self::utxos) or [`add_utxo`](Self::add_utxo).</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// When bumping the fees of a transaction made with this option, the user should remeber to</span>
+ <span class="doccomment">/// add [`maintain_single_recipient`](Self::maintain_single_recipient) to correctly update the</span>
+ <span class="doccomment">/// single output instead of adding one more for the change.</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set_single_recipient</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">recipient</span>: <span class="ident">Script</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
+ <span class="self">self</span>.<span class="ident">single_recipient</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">recipient</span>);
+ <span class="self">self</span>.<span class="ident">recipients</span>.<span class="ident">clear</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="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">rbf</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">RBFValue</span>::<span class="ident">Default</span>);
+ <span class="self">self</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">RBFValue</span>::<span class="ident">Value</span>(<span class="ident">nsequence</span>));
+ <span class="self">self</span>
+ }
+}
+
+<span class="comment">// methods supported only by bump_fee</span>
+<span class="kw">impl</span><span class="op"><</span><span class="ident">D</span>: <span class="ident">Database</span><span class="op">></span> <span class="ident">TxBuilder</span><span class="op"><</span><span class="ident">D</span>, <span class="ident">DefaultCoinSelectionAlgorithm</span>, <span class="ident">BumpFee</span><span class="op">></span> {
+ <span class="doccomment">/// Bump the fees of a transaction made with [`set_single_recipient`](Self::set_single_recipient)</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Unless extra inputs are specified with [`add_utxo`] or [`utxos`], this flag will make</span>
+ <span class="doccomment">/// `bump_fee` reduce the value of the existing output, or fail if it would be consumed</span>
+ <span class="doccomment">/// entirely given the higher new fee rate.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// If extra inputs are added and they are not entirely consumed in fees, a change output will not</span>
+ <span class="doccomment">/// be added; the existing output will simply grow in value.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// Fails if the transaction has more than one outputs.</span>
+ <span class="doccomment">///</span>
+ <span class="doccomment">/// [`add_utxo`]: Self::add_utxo</span>
+ <span class="doccomment">/// [`utxos`]: Self::utxos</span>
+ <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">maintain_single_recipient</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">single_recipient</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Script</span>::<span class="ident">default</span>());
+ <span class="self">self</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="doccomment">/// Sort transaction inputs and outputs by [`TxOrdering`] variant</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">i32</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">/// RBF nSequence value</span>
+<span class="doccomment">///</span>
+<span class="doccomment">/// Has a default value of `0xFFFFFFFD`</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">enum</span> <span class="ident">RBFValue</span> {
+ <span class="ident">Default</span>,
+ <span class="ident">Value</span>(<span class="ident">u32</span>),
+}
+
+<span class="kw">impl</span> <span class="ident">RBFValue</span> {
+ <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">get_value</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u32</span> {
+ <span class="kw">match</span> <span class="self">self</span> {
+ <span class="ident">RBFValue</span>::<span class="ident">Default</span> <span class="op">=</span><span class="op">></span> <span class="number">0xFFFFFFFD</span>,
+ <span class="ident">RBFValue</span>::<span class="ident">Value</span>(<span class="ident">v</span>) <span class="op">=</span><span class="op">></span> <span class="kw-2">*</span><span class="ident">v</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">is_satisfied_by</span>(<span class="kw-2">&</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="ident">bool</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="bool-val">true</span>,
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">OnlyChange</span> <span class="op">=</span><span class="op">></span> <span class="ident">utxo</span>.<span class="ident">keychain</span> <span class="op">=</span><span class="op">=</span> <span class="ident">KeychainKind</span>::<span class="ident">Internal</span>,
+ <span class="ident">ChangeSpendPolicy</span>::<span class="ident">ChangeForbidden</span> <span class="op">=</span><span class="op">></span> <span class="ident">utxo</span>.<span class="ident">keychain</span> <span class="op">=</span><span class="op">=</span> <span class="ident">KeychainKind</span>::<span class="ident">External</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">External</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">keychain</span>: <span class="ident">KeychainKind</span>::<span class="ident">Internal</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">get_test_utxos</span>()
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">change_spend_policy</span>.<span class="ident">is_satisfied_by</span>(<span class="ident">u</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="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">get_test_utxos</span>()
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">change_spend_policy</span>.<span class="ident">is_satisfied_by</span>(<span class="ident">u</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="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">keychain</span>, <span class="ident">KeychainKind</span>::<span class="ident">External</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">get_test_utxos</span>()
+ .<span class="ident">into_iter</span>()
+ .<span class="ident">filter</span>(<span class="op">|</span><span class="ident">u</span><span class="op">|</span> <span class="ident">change_spend_policy</span>.<span class="ident">is_satisfied_by</span>(<span class="ident">u</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="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">keychain</span>, <span class="ident">KeychainKind</span>::<span class="ident">Internal</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 of the Rust file `src/wallet/utils.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>utils.rs - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
+<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
+ <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>
+</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">secp256k1</span>::{<span class="ident">All</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="kw">use</span> <span class="ident">miniscript</span>::<span class="ident">descriptor</span>::<span class="ident">DescriptorPublicKeyCtx</span>;
+<span class="kw">use</span> <span class="ident">miniscript</span>::{<span class="ident">MiniscriptKey</span>, <span class="ident">Satisfier</span>, <span class="ident">ToPublicKey</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="comment">// MSB of the nSequence. If set there's no consensus-constraint, so it must be disabled when</span>
+<span class="comment">// spending using CSV in order to enforce CSV rules</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">SEQUENCE_LOCKTIME_DISABLE_FLAG</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">1</span> <span class="op"><</span><span class="op"><</span> <span class="number">31</span>;
+<span class="comment">// When nSequence is lower than this flag the timelock is interpreted as block-height-based,</span>
+<span class="comment">// otherwise it's time-based</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">1</span> <span class="op"><</span><span class="op"><</span> <span class="number">22</span>;
+<span class="comment">// Mask for the bits used to express the timelock</span>
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">SEQUENCE_LOCKTIME_MASK</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">0x0000FFFF</span>;
+
+<span class="comment">// Threshold for nLockTime to be considered a block-height-based timelock rather than time-based</span>
+<span class="kw">pub</span>(<span class="kw">crate</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="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">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">check_nsequence_rbf</span>(<span class="ident">rbf</span>: <span class="ident">u32</span>, <span class="ident">csv</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="comment">// This flag cannot be set in the nSequence when spending using OP_CSV</span>
+ <span class="kw">if</span> <span class="ident">rbf</span> <span class="op">&</span> <span class="ident">SEQUENCE_LOCKTIME_DISABLE_FLAG</span> <span class="op">!</span><span class="op">=</span> <span class="number">0</span> {
+ <span class="kw">return</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="kw">let</span> <span class="ident">mask</span> <span class="op">=</span> <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span> <span class="op">|</span> <span class="ident">SEQUENCE_LOCKTIME_MASK</span>;
+ <span class="kw">let</span> <span class="ident">rbf</span> <span class="op">=</span> <span class="ident">rbf</span> <span class="op">&</span> <span class="ident">mask</span>;
+ <span class="kw">let</span> <span class="ident">csv</span> <span class="op">=</span> <span class="ident">csv</span> <span class="op">&</span> <span class="ident">mask</span>;
+
+ <span class="comment">// Both values should be represented in the same unit (either time-based or</span>
+ <span class="comment">// block-height based)</span>
+ <span class="kw">if</span> (<span class="ident">rbf</span> <span class="op"><</span> <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span>) <span class="op">!</span><span class="op">=</span> (<span class="ident">csv</span> <span class="op"><</span> <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span>) {
+ <span class="kw">return</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="comment">// The value should be at least `csv`</span>
+ <span class="kw">if</span> <span class="ident">rbf</span> <span class="op"><</span> <span class="ident">csv</span> {
+ <span class="kw">return</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="bool-val">true</span>
+}
+
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">check_nlocktime</span>(<span class="ident">nlocktime</span>: <span class="ident">u32</span>, <span class="ident">required</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
+ <span class="comment">// Both values should be expressed in the same unit</span>
+ <span class="kw">if</span> (<span class="ident">nlocktime</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) <span class="op">!</span><span class="op">=</span> (<span class="ident">required</span> <span class="op"><</span> <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>) {
+ <span class="kw">return</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="comment">// The value should be at least `required`</span>
+ <span class="kw">if</span> <span class="ident">nlocktime</span> <span class="op"><</span> <span class="ident">required</span> {
+ <span class="kw">return</span> <span class="bool-val">false</span>;
+ }
+
+ <span class="bool-val">true</span>
+}
+
+<span class="kw">impl</span><span class="op"><</span><span class="ident">ToPkCtx</span>: <span class="ident">Copy</span>, <span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span> <span class="op">+</span> <span class="ident">ToPublicKey</span><span class="op"><</span><span class="ident">ToPkCtx</span><span class="op">></span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">ToPkCtx</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">ToPkCtx</span>: <span class="ident">Copy</span>, <span class="ident">Pk</span>: <span class="ident">MiniscriptKey</span> <span class="op">+</span> <span class="ident">ToPublicKey</span><span class="op"><</span><span class="ident">ToPkCtx</span><span class="op">></span><span class="op">></span> <span class="ident">Satisfier</span><span class="op"><</span><span class="ident">ToPkCtx</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">crate</span>) <span class="kw">type</span> <span class="ident">SecpCtx</span> <span class="op">=</span> <span class="ident">Secp256k1</span><span class="op"><</span><span class="ident">All</span><span class="op">></span>;
+<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">descriptor_to_pk_ctx</span>(<span class="ident">secp</span>: <span class="kw-2">&</span><span class="ident">SecpCtx</span>) <span class="op">-</span><span class="op">></span> <span class="ident">DescriptorPublicKeyCtx</span><span class="op"><</span><span class="lifetime">'_</span>, <span class="ident">All</span><span class="op">></span> {
+ <span class="comment">// Create a `to_pk_ctx` with a dummy derivation index, since we always use this on descriptor</span>
+ <span class="comment">// that have already been derived with `Descriptor::derive()`, so the child number added here</span>
+ <span class="comment">// is ignored.</span>
+ <span class="ident">DescriptorPublicKeyCtx</span>::<span class="ident">new</span>(<span class="ident">secp</span>, <span class="ident">bip32</span>::<span class="ident">ChildNumber</span>::<span class="ident">Normal</span> { <span class="ident">index</span>: <span class="number">0</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="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">super</span>::{
+ <span class="ident">check_nlocktime</span>, <span class="ident">check_nsequence_rbf</span>, <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span>,
+ <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</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>);
+ }
+
+ <span class="attribute">#[<span class="ident">test</span>]</span>
+ <span class="kw">fn</span> <span class="ident">test_check_nsequence_rbf_msb_set</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(<span class="number">0x80000000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nsequence_rbf_lt_csv</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(<span class="number">4000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nsequence_rbf_different_unit</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(<span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span> <span class="op">+</span> <span class="number">5000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nsequence_rbf_mask</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(<span class="number">0x3f</span> <span class="op">+</span> <span class="number">10_000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nsequence_rbf_same_unit_blocks</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(<span class="number">10_000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nsequence_rbf_same_unit_time</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nsequence_rbf</span>(
+ <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span> <span class="op">+</span> <span class="number">10_000</span>,
+ <span class="ident">SEQUENCE_LOCKTIME_TYPE_FLAG</span> <span class="op">+</span> <span class="number">5000</span>,
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nlocktime_lt_cltv</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nlocktime</span>(<span class="number">4000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nlocktime_different_unit</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nlocktime</span>(<span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span> <span class="op">+</span> <span class="number">5000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nlocktime_same_unit_blocks</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nlocktime</span>(<span class="number">10_000</span>, <span class="number">5000</span>);
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</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_check_nlocktime_same_unit_time</span>() {
+ <span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">check_nlocktime</span>(
+ <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span> <span class="op">+</span> <span class="number">10_000</span>,
+ <span class="ident">BLOCKS_TIMELOCK_THRESHOLD</span> <span class="op">+</span> <span class="number">5000</span>,
+ );
+ <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>, <span class="bool-val">true</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 darkThemes=["dark","ayu"];var currentTheme=document.getElementById("themeStyle");var mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");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(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}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}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("rustdoc-use-system-theme",value);var toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}var updateSystemTheme=(function(){if(!window.matchMedia){return function(){let cssTheme=getComputedStyle(document.documentElement).getPropertyValue('content');switchTheme(currentTheme,mainTheme,JSON.parse(cssTheme)||light,true)}}var mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){if(getSettingValue("use-system-theme")!=="false"){var lightTheme=getSettingValue("preferred-light-theme")||"light";var darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){switchTheme(currentTheme,mainTheme,darkTheme,true)}else{switchTheme(currentTheme,mainTheme,lightTheme,true)}}}mql.addListener(handlePreferenceChange);return function(){handlePreferenceChange(mql)}})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(currentTheme,mainTheme,getSettingValue("theme")||"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!=="theme-picker"&&(!active.parentNode||active.parentNode.id!=="theme-choices")&&(!related||(related.id!=="theme-picker"&&(!related.parentNode||related.parentNode.id!=="theme-choices")))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;["ayu","dark","light"].forEach(function(item){var but=document.createElement("button");but.textContent=item;but.onclick=function(el){switchTheme(currentTheme,mainTheme,item,true);useSystemTheme(false)};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