From: github-actions Date: Tue, 13 Aug 2024 20:59:41 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/enum.ObservedAs.html?a=commitdiff_plain;h=950bee3544c3164d216d6a46a966f3ec0d4b49ad;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html index 669e5bb9da..91776617a4 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html @@ -1,18 +1,18 @@ BlockEvent in bdk_bitcoind_rpc - Rust

Struct bdk_bitcoind_rpc::BlockEvent

source ·
pub struct BlockEvent<B> {
     pub block: B,
-    pub checkpoint: CheckPoint,
+    pub checkpoint: CheckPoint,
 }
Expand description

A newly emitted block from Emitter.

Fields§

§block: B

Either a full [Block] or [Header] of the new block.

-
§checkpoint: CheckPoint

The checkpoint of the new block.

-

A [CheckPoint] is a node of a linked list of [BlockId]s. This checkpoint is linked to -all [BlockId]s originally passed in Emitter::new as well as emitted blocks since then. +

§checkpoint: CheckPoint

The checkpoint of the new block.

+

A CheckPoint is a node of a linked list of BlockIds. This checkpoint is linked to +all BlockIds originally passed in Emitter::new as well as emitted blocks since then. These blocks are guaranteed to be of the same chain.

This is important as BDK structures require block-to-apply to be connected with another block in the original chain.

Implementations§

source§

impl<B> BlockEvent<B>

source

pub fn block_height(&self) -> u32

The block height of this new block.

source

pub fn block_hash(&self) -> BlockHash

The block hash of this new block.

-
source

pub fn connected_to(&self) -> BlockId

The [BlockId] of a previous block that this block connects to.

-

This either returns a [BlockId] of a previously emitted block or from the chain we started +

source

pub fn connected_to(&self) -> BlockId

The BlockId of a previous block that this block connects to.

+

This either returns a BlockId of a previously emitted block or from the chain we started with (passed in as last_cp in Emitter::new).

This value is derived from BlockEvent::checkpoint.

Trait Implementations§

source§

impl<B: Debug> Debug for BlockEvent<B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> Freeze for BlockEvent<B>
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html index de6ba10c97..149f551486 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html @@ -1,6 +1,6 @@ Emitter in bdk_bitcoind_rpc - Rust

Struct bdk_bitcoind_rpc::Emitter

source ·
pub struct Emitter<'c, C> { /* private fields */ }
Expand description

The Emitter is used to emit data sourced from [bitcoincore_rpc::Client].

Refer to module-level documentation for more.

-

Implementations§

source§

impl<'c, C: RpcApi> Emitter<'c, C>

source

pub fn new(client: &'c C, last_cp: CheckPoint, start_height: u32) -> Self

Construct a new Emitter.

+

Implementations§

source§

impl<'c, C: RpcApi> Emitter<'c, C>

source

pub fn new(client: &'c C, last_cp: CheckPoint, start_height: u32) -> Self

Construct a new Emitter.

last_cp informs the emitter of the chain we are starting off with. This way, the emitter can start emission from a block that connects to the original chain.

start_height starts emission from a given height (if there are no conflicts with the diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/index.html index 814a38be10..b89ba19f10 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/index.html @@ -27,6 +27,6 @@ has shown a user. bdk_chain -via a new TxGraph to be appended to any existing TxGraph data.

+via a new TxGraph to be appended to any existing TxGraph data.

Refer to example_esplora for a complete example.

Re-exports§

  • pub use esplora_client;

Traits§

  • Trait to extend the functionality of [esplora_client::AsyncClient].
  • Trait to extend the functionality of [esplora_client::BlockingClient].

Type Aliases§

  • [esplora_client::Error]
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html index 7e04c8b710..108ab63259 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html @@ -2,35 +2,35 @@ // Required methods fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize - ) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>> + ) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>> where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait; fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize - ) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>> + ) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Trait to extend the functionality of [esplora_client::AsyncClient].

Refer to crate-level documentation for more.

Required Methods§

source

fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
where +) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait,

Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures.

  • request: struct with data required to perform a spk-based blockchain client full scan, -see [FullScanRequest]
  • +see FullScanRequest

The full scan for each keychain stops after a gap of stop_gap script pubkeys with no associated transactions. parallel_requests specifies the max number of HTTP requests to @@ -46,30 +46,30 @@ and

source

fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
where +) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sync a set of scripts with the blockchain (via an Esplora client) for the data -specified and return a [TxGraph].

+specified and return a TxGraph.

  • request: struct with data required to perform a spk-based blockchain client sync, see -[SyncRequest]
  • +SyncRequest

If the scripts to sync are unknown, such as when restoring or importing a keychain that may include scripts that have been used, use full_scan with the keychain.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EsploraAsyncExt for AsyncClient

source§

fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
where +) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait,

source§

fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
where +) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html index 05f612d21f..bc0b24cf98 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html @@ -2,27 +2,27 @@ // Required methods fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize - ) -> Result<FullScanResult<K>, Error>; + ) -> Result<FullScanResult<K>, Error>; fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize - ) -> Result<SyncResult, Error>; + ) -> Result<SyncResult, Error>; }
Expand description

Trait to extend the functionality of [esplora_client::BlockingClient].

Refer to crate-level documentation for more.

Required Methods§

source

fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Result<FullScanResult<K>, Error>

Scan keychain scripts for transactions against Esplora, returning an update that can be +) -> Result<FullScanResult<K>, Error>

Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures.

  • request: struct with data required to perform a spk-based blockchain client full scan, -see [FullScanRequest]
  • +see FullScanRequest

The full scan for each keychain stops after a gap of stop_gap script pubkeys with no associated transactions. parallel_requests specifies the max number of HTTP requests to @@ -38,23 +38,23 @@ and

source

fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Result<SyncResult, Error>

Sync a set of scripts with the blockchain (via an Esplora client) for the data -specified and return a [TxGraph].

+) -> Result<SyncResult, Error>

Sync a set of scripts with the blockchain (via an Esplora client) for the data +specified and return a TxGraph.

  • request: struct with data required to perform a spk-based blockchain client sync, see -[SyncRequest]
  • +SyncRequest

If the scripts to sync are unknown, such as when restoring or importing a keychain that may include scripts that have been used, use full_scan with the keychain.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EsploraExt for BlockingClient

source§

fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Result<FullScanResult<K>, Error>

source§

fn sync( +) -> Result<FullScanResult<K>, Error>

source§

fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Result<SyncResult, Error>

Implementors§

\ No newline at end of file +) -> Result<SyncResult, Error>

Implementors§

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html index 5670758c97..dcd4957839 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html @@ -1,7 +1,7 @@ Store in bdk_file_store - Rust

Struct bdk_file_store::Store

source ·
pub struct Store<C>
where C: Sync + Send,
{ /* private fields */ }
Expand description

Persists an append-only list of changesets (C) to a single file.

Implementations§

source§

impl<C> Store<C>
where - C: Merge + Serialize + DeserializeOwned + Send + Sync,

source

pub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>

source

pub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>
where P: AsRef<Path>,

Create a new Store file in write-only mode; error if the file exists.

magic is the prefixed bytes to write to the new file. This will be checked when opening the Store in the future with open.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html index 1566af4708..89fa4e84cf 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/enum.Descriptor.html @@ -236,8 +236,8 @@ default(0x02) y-coordinate.

This function will return an error if hardened derivation is attempted.

Trait Implementations§

§

impl<Pk> Clone for Descriptor<Pk>
where Pk: Clone + MiniscriptKey,

§

fn clone(&self) -> Descriptor<Pk>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<Pk> Debug for Descriptor<Pk>
where - Pk: MiniscriptKey,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl DescriptorExt for Descriptor<DescriptorPublicKey>

§

fn dust_value(&self) -> u64

Returns the minimum value (in satoshis) at which an output is broadcastable. -Panics if the descriptor wildcard is hardened.
§

fn descriptor_id(&self) -> DescriptorId

Returns the descriptor ID, calculated as the sha256 hash of the spk derived from the + Pk: MiniscriptKey,
§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl DescriptorExt for Descriptor<DescriptorPublicKey>

source§

fn dust_value(&self) -> u64

Returns the minimum value (in satoshis) at which an output is broadcastable. +Panics if the descriptor wildcard is hardened.
source§

fn descriptor_id(&self) -> DescriptorId

Returns the descriptor ID, calculated as the sha256 hash of the spk derived from the descriptor at index 0.
§

impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
where Pk: FromStrKey,

§

fn deserialize<D>( deserializer: D diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.ApplyBlockError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.ApplyBlockError.html index 78e351655f..a91425ad73 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.ApplyBlockError.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.ApplyBlockError.html @@ -1,11 +1,11 @@ ApplyBlockError in bdk_wallet - Rust

Enum bdk_wallet::ApplyBlockError

source ·
pub enum ApplyBlockError {
-    CannotConnect(CannotConnectError),
+    CannotConnect(CannotConnectError),
     UnexpectedConnectedToHash {
         connected_to_hash: BlockHash,
         expected_hash: BlockHash,
     },
 }
Expand description

An error that may occur when applying a block to Wallet.

-

Variants§

§

CannotConnect(CannotConnectError)

Occurs when the update chain cannot connect with original chain.

+

Variants§

§

CannotConnect(CannotConnectError)

Occurs when the update chain cannot connect with original chain.

§

UnexpectedConnectedToHash

Occurs when the connected_to hash does not match the hash derived from block.

Fields

§connected_to_hash: BlockHash

Block hash of connected_to.

§expected_hash: BlockHash

Expected block hash of connected_to, as derived from block.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.CreateWithPersistError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.CreateWithPersistError.html index 944ce36354..c66013932d 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.CreateWithPersistError.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.CreateWithPersistError.html @@ -1,7 +1,7 @@ CreateWithPersistError in bdk_wallet - Rust

Enum bdk_wallet::CreateWithPersistError

source ·
pub enum CreateWithPersistError<E> {
     Persist(E),
     Descriptor(DescriptorError),
-}
Expand description

Error type for [PersistedWallet::create].

+}
Expand description

Error type for PersistedWallet::create.

Variants§

§

Persist(E)

Error from persistence.

§

Descriptor(DescriptorError)

Occurs when the loaded changeset cannot construct Wallet.

Trait Implementations§

source§

impl<E: Debug> Debug for CreateWithPersistError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Display> Display for CreateWithPersistError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Debug + Display> Error for CreateWithPersistError<E>

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl<E> Freeze for CreateWithPersistError<E>
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadMismatch.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadMismatch.html index ea97fa0796..55a897f39b 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadMismatch.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadMismatch.html @@ -19,7 +19,7 @@

§

Genesis

Genesis hash does not match.

Fields

§loaded: BlockHash

The genesis hash that is loaded.

§expected: BlockHash

The expected genesis hash.

-
§

Descriptor

Descriptor’s DescriptorId does not match.

+
§

Descriptor

Descriptor’s DescriptorId does not match.

Fields

§keychain: KeychainKind

Keychain identifying the descriptor.

§loaded: ExtendedDescriptor

The loaded descriptor.

§expected: ExtendedDescriptor

The expected descriptor.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadWithPersistError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadWithPersistError.html index d1e18149a3..13b92f69af 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadWithPersistError.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/enum.LoadWithPersistError.html @@ -1,7 +1,7 @@ LoadWithPersistError in bdk_wallet - Rust

Enum bdk_wallet::LoadWithPersistError

source ·
pub enum LoadWithPersistError<E> {
     Persist(E),
     InvalidChangeSet(LoadError),
-}
Expand description

Error type for [PersistedWallet::load].

+}
Expand description

Error type for PersistedWallet::load.

Variants§

§

Persist(E)

Error from persistence.

§

InvalidChangeSet(LoadError)

Occurs when the loaded changeset cannot construct Wallet.

Trait Implementations§

source§

impl<E: Debug> Debug for LoadWithPersistError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Display> Display for LoadWithPersistError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Debug + Display> Error for LoadWithPersistError<E>

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl<E> From<LoadMismatch> for LoadWithPersistError<E>

source§

fn from(mismatch: LoadMismatch) -> Self

Converts to this type from the input type.
source§

impl<E: PartialEq> PartialEq for LoadWithPersistError<E>

source§

fn eq(&self, other: &LoadWithPersistError<E>) -> bool

This method tests for self and other values to be equal, and is used diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/index.html index 2fcd4d82ba..25049edcba 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/index.html @@ -182,7 +182,7 @@ that the Wallet can use to update its view of the chain.

submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

-

Re-exports§

  • pub extern crate bitcoin;
  • pub extern crate bdk_chain as chain;
  • pub extern crate bdk_file_store as file_store;
  • pub extern crate miniscript;
  • pub extern crate serde;
  • pub extern crate serde_json;
  • pub use descriptor::template;
  • pub use descriptor::HdKeyPaths;
  • pub use signer;
  • pub use bdk_chain::rusqlite;

Modules§

Macros§

  • Macro to write full descriptors with code
  • Macro to write descriptor fragments with code

Structs§

Enums§

Traits§

  • Trait to check if a value is below the dust limit. +

Re-exports§

  • pub extern crate bitcoin;
  • pub extern crate bdk_chain as chain;
  • pub extern crate bdk_file_store as file_store;
  • pub extern crate miniscript;
  • pub extern crate serde;
  • pub extern crate serde_json;
  • pub use descriptor::template;
  • pub use descriptor::HdKeyPaths;
  • pub use signer;
  • pub use bdk_chain::rusqlite;

Modules§

Macros§

  • Macro to write full descriptors with code
  • Macro to write descriptor fragments with code

Structs§

Enums§

Traits§

  • Trait to check if a value is below the dust limit. We are performing dust value calculation for a given script public key using rust-bitcoin to keep it compatible with network dust rate

Functions§

Type Aliases§

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/constant.SCHEMAS_TABLE_NAME.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/constant.SCHEMAS_TABLE_NAME.html index 103e80b1c3..b781c92b5c 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/constant.SCHEMAS_TABLE_NAME.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/constant.SCHEMAS_TABLE_NAME.html @@ -1,2 +1,2 @@ -SCHEMAS_TABLE_NAME in bdk_wallet::rusqlite_impl - Rust

Constant bdk_wallet::rusqlite_impl::SCHEMAS_TABLE_NAME

pub const SCHEMAS_TABLE_NAME: &'static str;
Expand description

Table name for schemas.

+SCHEMAS_TABLE_NAME in bdk_wallet::rusqlite_impl - Rust

Constant bdk_wallet::rusqlite_impl::SCHEMAS_TABLE_NAME

source ·
pub const SCHEMAS_TABLE_NAME: &'static str;
Expand description

Table name for schemas.

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/fn.migrate_schema.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/fn.migrate_schema.html index 59793b065e..0778117907 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/fn.migrate_schema.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/fn.migrate_schema.html @@ -1,4 +1,4 @@ -migrate_schema in bdk_wallet::rusqlite_impl - Rust

Function bdk_wallet::rusqlite_impl::migrate_schema

pub fn migrate_schema(
+migrate_schema in bdk_wallet::rusqlite_impl - Rust

Function bdk_wallet::rusqlite_impl::migrate_schema

source ·
pub fn migrate_schema(
     db_tx: &Transaction<'_>,
     schema_name: &str,
     versioned_scripts: &[&[&str]]
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/index.html
index 8b9753b918..0eb25f1016 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/index.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/rusqlite_impl/index.html
@@ -1,2 +1,2 @@
-bdk_wallet::rusqlite_impl - Rust

Module bdk_wallet::rusqlite_impl

Expand description

Module for stuff

+bdk_wallet::rusqlite_impl - Rust

Module bdk_wallet::rusqlite_impl

source ·
Expand description

Module for stuff

Constants§

Functions§

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Balance.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Balance.html index bed43ff49f..8199822677 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Balance.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Balance.html @@ -1,4 +1,4 @@ -Balance in bdk_wallet - Rust

Struct bdk_wallet::Balance

pub struct Balance {
+Balance in bdk_wallet - Rust

Struct bdk_wallet::Balance

source ·
pub struct Balance {
     pub immature: Amount,
     pub trusted_pending: Amount,
     pub untrusted_pending: Amount,
@@ -8,20 +8,20 @@
 
§trusted_pending: Amount

Unconfirmed UTXOs generated by a wallet tx

§untrusted_pending: Amount

Unconfirmed UTXOs received from an external wallet

§confirmed: Amount

Confirmed and immediately spendable balance

-

Implementations§

§

impl Balance

pub fn trusted_spendable(&self) -> Amount

Get sum of trusted_pending and confirmed coins.

+

Implementations§

source§

impl Balance

source

pub fn trusted_spendable(&self) -> Amount

Get sum of trusted_pending and confirmed coins.

This is the balance you can spend right now that shouldn’t get cancelled via another party double spending it.

-

pub fn total(&self) -> Amount

Get the whole balance visible to the wallet.

-

Trait Implementations§

§

impl Add for Balance

§

type Output = Balance

The resulting type after applying the + operator.
§

fn add(self, other: Balance) -> Balance

Performs the + operation. Read more
§

impl Clone for Balance

§

fn clone(&self) -> Balance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Balance

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Balance

§

fn default() -> Balance

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Balance

§

fn deserialize<__D>( +

source

pub fn total(&self) -> Amount

Get the whole balance visible to the wallet.

+

Trait Implementations§

source§

impl Add for Balance

§

type Output = Balance

The resulting type after applying the + operator.
source§

fn add(self, other: Balance) -> Balance

Performs the + operation. Read more
source§

impl Clone for Balance

source§

fn clone(&self) -> Balance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Balance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Balance

source§

fn default() -> Balance

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Balance

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Balance, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Balance

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for Balance

§

fn eq(&self, other: &Balance) -> bool

This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Balance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for Balance

source§

fn eq(&self, other: &Balance) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Serialize for Balance

§

fn serialize<__S>( +sufficient, and should not be overridden without very good reason.

source§

impl Serialize for Balance

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for Balance

§

impl StructuralPartialEq for Balance

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Balance

source§

impl StructuralPartialEq for Balance

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.ChangeSet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.ChangeSet.html index b36823b119..04c065e709 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.ChangeSet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.ChangeSet.html @@ -2,23 +2,23 @@ pub descriptor: Option<Descriptor<DescriptorPublicKey>>, pub change_descriptor: Option<Descriptor<DescriptorPublicKey>>, pub network: Option<Network>, - pub local_chain: ChangeSet, - pub tx_graph: ChangeSet<ConfirmationBlockTime>, - pub indexer: ChangeSet, + pub local_chain: ChangeSet, + pub tx_graph: ChangeSet<ConfirmationBlockTime>, + pub indexer: ChangeSet, }
Expand description

A changeset for Wallet.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§descriptor: Option<Descriptor<DescriptorPublicKey>>

Descriptor for recipient addresses.

§change_descriptor: Option<Descriptor<DescriptorPublicKey>>

Descriptor for change addresses.

§network: Option<Network>

Stores the network type of the transaction data.

-
§local_chain: ChangeSet

Changes to the LocalChain.

-
§tx_graph: ChangeSet<ConfirmationBlockTime>

Changes to TxGraph.

-
§indexer: ChangeSet

Changes to KeychainTxOutIndex.

+
§local_chain: ChangeSet

Changes to the LocalChain.

+
§tx_graph: ChangeSet<ConfirmationBlockTime>

Changes to TxGraph.

+
§indexer: ChangeSet

Changes to KeychainTxOutIndex.

Implementations§

source§

impl ChangeSet

source

pub const WALLET_SCHEMA_NAME: &'static str = "bdk_wallet"

Schema name for wallet.

source

pub const WALLET_TABLE_NAME: &'static str = "bdk_wallet"

Name of table to store wallet descriptors and network.

source

pub fn from_sqlite(db_tx: &Transaction<'_>) -> Result<Self>

Recover a ChangeSet from sqlite database.

source

pub fn persist_to_sqlite(&self, db_tx: &Transaction<'_>) -> Result<()>

Persist ChangeSet to sqlite database.

Trait Implementations§

source§

impl Clone for ChangeSet

source§

fn clone(&self) -> ChangeSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ChangeSet

source§

fn default() -> ChangeSet

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ChangeSet

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeSet<ConfirmationBlockTime>> for ChangeSet

source§

fn from(tx_graph: ChangeSet<ConfirmationBlockTime>) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet<ConfirmationBlockTime, ChangeSet>> for ChangeSet

source§

fn from(indexed_tx_graph: ChangeSet<ConfirmationBlockTime, ChangeSet>) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet> for ChangeSet

source§

fn from(chain: ChangeSet) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet> for ChangeSet

source§

fn from(indexer: ChangeSet) -> Self

Converts to this type from the input type.
source§

impl Merge for ChangeSet

source§

fn merge(&mut self, other: Self)

Merge another ChangeSet into itself.

-
source§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
source§

impl PartialEq for ChangeSet

source§

fn eq(&self, other: &ChangeSet) -> bool

This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeSet<ConfirmationBlockTime>> for ChangeSet

source§

fn from(tx_graph: ChangeSet<ConfirmationBlockTime>) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet<ConfirmationBlockTime, ChangeSet>> for ChangeSet

source§

fn from(indexed_tx_graph: ChangeSet<ConfirmationBlockTime, ChangeSet>) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet> for ChangeSet

source§

fn from(chain: ChangeSet) -> Self

Converts to this type from the input type.
source§

impl From<ChangeSet> for ChangeSet

source§

fn from(indexer: ChangeSet) -> Self

Converts to this type from the input type.
source§

impl Merge for ChangeSet

source§

fn merge(&mut self, other: Self)

Merge another ChangeSet into itself.

+
source§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
source§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
source§

impl PartialEq for ChangeSet

source§

fn eq(&self, other: &ChangeSet) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ChangeSet

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ChangeSet

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.CreateParams.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.CreateParams.html index 89ad6c4c65..ddadde1924 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.CreateParams.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.CreateParams.html @@ -1,9 +1,9 @@ -CreateParams in bdk_wallet - Rust

Struct bdk_wallet::CreateParams

source ·
pub struct CreateParams { /* private fields */ }
Expand description

Parameters for Wallet::create or [PersistedWallet::create].

+CreateParams in bdk_wallet - Rust

Struct bdk_wallet::CreateParams

source ·
pub struct CreateParams { /* private fields */ }
Expand description

Implementations§

source§

impl CreateParams

source

pub fn new<D: IntoWalletDescriptor + 'static>( descriptor: D, change_descriptor: D ) -> Self

Construct parameters with provided descriptor, change_descriptor and network.

-

Default values: genesis_hash = None, lookahead = [DEFAULT_LOOKAHEAD]

+

Default values: genesis_hash = None, lookahead = DEFAULT_LOOKAHEAD

source

pub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self

Extend the given keychain’s keymap.

source

pub fn network(self, network: Network) -> Self

Set network.

source

pub fn genesis_hash(self, genesis_hash: BlockHash) -> Self

Use a custom genesis_hash.

@@ -11,13 +11,13 @@
source

pub fn create_wallet<Db>( self, db: &mut Db -) -> Result<PersistedWallet, <Wallet as PersistWith<Db>>::CreateError>
where - Wallet: PersistWith<Db, CreateParams = Self>,

Create PersistedWallet with the given Db.

+) -> Result<PersistedWallet, <Wallet as PersistWith<Db>>::CreateError>
where + Wallet: PersistWith<Db, CreateParams = Self>,

Create PersistedWallet with the given Db.

source

pub async fn create_wallet_async<Db>( self, db: &mut Db -) -> Result<PersistedWallet, <Wallet as PersistAsyncWith<Db>>::CreateError>
where - Wallet: PersistAsyncWith<Db, CreateParams = Self>,

Create PersistedWallet with the given async Db.

+) -> Result<PersistedWallet, <Wallet as PersistAsyncWith<Db>>::CreateError>
where + Wallet: PersistAsyncWith<Db, CreateParams = Self>,

Create PersistedWallet with the given async Db.

source

pub fn create_wallet_no_persist(self) -> Result<Wallet, DescriptorError>

Create Wallet without persistence.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LoadParams.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LoadParams.html index fc016e1c11..f1642ad959 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LoadParams.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LoadParams.html @@ -1,6 +1,6 @@ -LoadParams in bdk_wallet - Rust

Struct bdk_wallet::LoadParams

source ·
pub struct LoadParams { /* private fields */ }
Expand description

Parameters for Wallet::load or [PersistedWallet::load].

+LoadParams in bdk_wallet - Rust

Struct bdk_wallet::LoadParams

source ·
pub struct LoadParams { /* private fields */ }
Expand description

Implementations§

source§

impl LoadParams

source

pub fn new() -> Self

Construct parameters with default values.

-

Default values: lookahead = [DEFAULT_LOOKAHEAD]

+

Default values: lookahead = DEFAULT_LOOKAHEAD

source

pub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self

Extend the given keychain’s keymap.

source

pub fn descriptors<D>(self, descriptor: D, change_descriptor: D) -> Self
where D: IntoWalletDescriptor + 'static,

Checks that descriptor of keychain matches this, and extracts private keys (if @@ -11,13 +11,13 @@ available).

source

pub fn load_wallet<Db>( self, db: &mut Db -) -> Result<Option<PersistedWallet>, <Wallet as PersistWith<Db>>::LoadError>
where - Wallet: PersistWith<Db, LoadParams = Self>,

Load PersistedWallet with the given Db.

+) -> Result<Option<PersistedWallet>, <Wallet as PersistWith<Db>>::LoadError>
where + Wallet: PersistWith<Db, LoadParams = Self>,

Load PersistedWallet with the given Db.

source

pub async fn load_wallet_async<Db>( self, db: &mut Db -) -> Result<Option<PersistedWallet>, <Wallet as PersistAsyncWith<Db>>::LoadError>
where - Wallet: PersistAsyncWith<Db, LoadParams = Self>,

Load PersistedWallet with the given async Db.

+) -> Result<Option<PersistedWallet>, <Wallet as PersistAsyncWith<Db>>::LoadError>
where + Wallet: PersistAsyncWith<Db, LoadParams = Self>,

Load PersistedWallet with the given async Db.

source

pub fn load_wallet_no_persist( self, changeset: ChangeSet diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html index d10c18b927..23e7e3d4b3 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html @@ -4,14 +4,14 @@ pub keychain: KeychainKind, pub is_spent: bool, pub derivation_index: u32, - pub confirmation_time: ConfirmationTime, + pub confirmation_time: ConfirmationTime, }
Expand description

An unspent output owned by a Wallet.

Fields§

§outpoint: OutPoint

Reference to a transaction output

§txout: TxOut

Transaction output

§keychain: KeychainKind

Type of keychain

§is_spent: bool

Whether this UTXO is spent or not

§derivation_index: u32

The derivation index for the script pubkey in the wallet

-
§confirmation_time: ConfirmationTime

The confirmation time for transaction containing this utxo

+
§confirmation_time: ConfirmationTime

The confirmation time for transaction containing this utxo

Trait Implementations§

source§

impl Clone for LocalOutput

source§

fn clone(&self) -> LocalOutput

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LocalOutput

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for LocalOutput

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for LocalOutput

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Update.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Update.html index 16fbd1de67..4f5ace21c7 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Update.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Update.html @@ -1,14 +1,14 @@ Update in bdk_wallet - Rust

Struct bdk_wallet::Update

source ·
pub struct Update {
     pub last_active_indices: BTreeMap<KeychainKind, u32>,
-    pub graph: TxGraph<ConfirmationBlockTime>,
-    pub chain: Option<CheckPoint>,
+    pub graph: TxGraph<ConfirmationBlockTime>,
+    pub chain: Option<CheckPoint>,
 }
Expand description

An update to Wallet.

-

It updates [KeychainTxOutIndex], [bdk_chain::TxGraph] and [local_chain::LocalChain] atomically.

+

It updates KeychainTxOutIndex, bdk_chain::TxGraph and local_chain::LocalChain atomically.

Fields§

§last_active_indices: BTreeMap<KeychainKind, u32>

Contains the last active derivation indices per keychain (K), which is used to update the -[KeychainTxOutIndex].

-
§graph: TxGraph<ConfirmationBlockTime>

Update for the wallet’s internal [TxGraph].

-
§chain: Option<CheckPoint>

Update for the wallet’s internal LocalChain.

-

Trait Implementations§

source§

impl Clone for Update

source§

fn clone(&self) -> Update

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Update

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Update

source§

fn default() -> Update

Returns the “default value” for a type. Read more
source§

impl From<FullScanResult<KeychainKind>> for Update

source§

fn from(value: FullScanResult<KeychainKind>) -> Self

Converts to this type from the input type.
source§

impl From<SyncResult> for Update

source§

fn from(value: SyncResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T§graph: TxGraph<ConfirmationBlockTime>

Update for the wallet’s internal TxGraph.

+
§chain: Option<CheckPoint>

Update for the wallet’s internal LocalChain.

+

Trait Implementations§

source§

impl Clone for Update

source§

fn clone(&self) -> Update

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Update

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Update

source§

fn default() -> Update

Returns the “default value” for a type. Read more
source§

impl From<FullScanResult<KeychainKind>> for Update

source§

fn from(value: FullScanResult<KeychainKind>) -> Self

Converts to this type from the input type.
source§

impl From<SyncResult> for Update

source§

fn from(value: SyncResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Wallet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Wallet.html index 33d2f26481..6fbf099075 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Wallet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/struct.Wallet.html @@ -9,7 +9,7 @@ Its main components are:

ChangeSets (see take_staged). Also see individual functions and example for instructions on when Wallet state needs to be persisted.

The Wallet descriptor (external) and change descriptor (internal) must not derive the same -script pubkeys. See [KeychainTxOutIndex::insert_descriptor()] for more details.

+script pubkeys. See KeychainTxOutIndex::insert_descriptor() for more details.

Implementations§

source§

impl Wallet

source

pub fn create<D>(descriptor: D, change_descriptor: D) -> CreateParams
where D: IntoWalletDescriptor + Clone + 'static,

Build a new Wallet.

If you have previously created a wallet, use load instead.

@@ -122,11 +122,11 @@ by using
source

pub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_

Return the list of unspent outputs of this wallet

source

pub fn list_output(&self) -> impl Iterator<Item = LocalOutput> + '_

List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).

To list only unspent outputs (UTXOs), use Wallet::list_unspent instead.

-
source

pub fn checkpoints(&self) -> CheckPointIter

Get all the checkpoints the wallet is currently storing indexed by height.

-
source

pub fn latest_checkpoint(&self) -> CheckPoint

Returns the latest checkpoint.

+
source

pub fn checkpoints(&self) -> CheckPointIter

Get all the checkpoints the wallet is currently storing indexed by height.

+
source

pub fn latest_checkpoint(&self) -> CheckPoint

Returns the latest checkpoint.

source

pub fn all_unbounded_spk_iters( &self -) -> BTreeMap<KeychainKind, impl Iterator<Item = Indexed<ScriptBuf>> + Clone>

Get unbounded script pubkey iterators for both Internal and External keychains.

+) -> BTreeMap<KeychainKind, impl Iterator<Item = Indexed<ScriptBuf>> + Clone>

Get unbounded script pubkey iterators for both Internal and External keychains.

This is intended to be used when doing a full scan of your addresses (e.g. after restoring from seed words). You pass the BTreeMap of iterators to a blockchain data source (e.g. electrum server) which will go through each address until it reaches a stop gap.

@@ -135,7 +135,7 @@ script pubkeys the wallet is storing internally).

source

pub fn unbounded_spk_iter( &self, keychain: KeychainKind -) -> impl Iterator<Item = Indexed<ScriptBuf>> + Clone

Get an unbounded script pubkey iterator for the given keychain.

+) -> impl Iterator<Item = Indexed<ScriptBuf>> + Clone

Get an unbounded script pubkey iterator for the given keychain.

See all_unbounded_spk_iters for more documentation

source

pub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput>

Returns the utxo owned by this wallet corresponding to outpoint if it exists in the wallet’s database.

@@ -151,7 +151,7 @@ See
source

pub fn calculate_fee( &self, tx: &Transaction -) -> Result<Amount, CalculateFeeError>

Calculates the fee of a given transaction. Returns [Amount::ZERO] if tx is a coinbase transaction.

+) -> Result<Amount, CalculateFeeError>

Calculates the fee of a given transaction. Returns [Amount::ZERO] if tx is a coinbase transaction.

To calculate the fee for a [Transaction] with inputs not owned by this wallet you must manually insert the TxOut(s) into the tx graph using the insert_txout function.

Note tx does not have to be in the graph for this to work.

@@ -164,7 +164,7 @@ manually insert the TxOut(s) into the tx graph using the
source

pub fn calculate_fee_rate( &self, tx: &Transaction -) -> Result<FeeRate, CalculateFeeError>

Calculate the [FeeRate] for a given transaction.

+) -> Result<FeeRate, CalculateFeeError>

Calculate the [FeeRate] for a given transaction.

To calculate the fee rate for a [Transaction] with inputs not owned by this wallet you must manually insert the TxOut(s) into the tx graph using the insert_txout function.

Note tx does not have to be in the graph for this to work.

@@ -187,12 +187,12 @@ of this tx’s outputs that send to script pubkeys tracked by this wallet.

source

pub fn get_tx( &self, txid: Txid -) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationBlockTime>>

Get a single transaction from the wallet as a [CanonicalTx] (if the transaction exists).

+) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationBlockTime>>

Get a single transaction from the wallet as a CanonicalTx (if the transaction exists).

CanonicalTx contains the full transaction alongside meta-data such as:

    -
  • Blocks that the transaction is Anchored in. These may or may not be blocks that exist +
  • Blocks that the transaction is Anchored in. These may or may not be blocks that exist in the best chain.
  • -
  • The [ChainPosition] of the transaction in the best chain - whether the transaction is +
  • The ChainPosition of the transaction in the best chain - whether the transaction is confirmed or unconfirmed. If the transaction is confirmed, the anchor which proves the confirmation is provided. If the transaction is unconfirmed, the unix timestamp of when the transaction was last seen in the mempool is provided.
  • @@ -227,8 +227,8 @@ the transaction was last seen in the mempool is provided. }
source

pub fn insert_checkpoint( &mut self, - block_id: BlockId -) -> Result<bool, AlterCheckPointError>

Add a new checkpoint to the wallet’s internal view of the chain.

+ block_id: BlockId +) -> Result<bool, AlterCheckPointError>

Add a new checkpoint to the wallet’s internal view of the chain.

Returns whether anything changed with the insertion (e.g. false if checkpoint was already there).

WARNING: You must persist the changes resulting from one or more calls to this method @@ -245,7 +245,7 @@ whether the transaction exists in the best chain. To know whether it exists, the must be broadcast to the network and the wallet synced via a chain source.

source

pub fn transactions( &self -) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationBlockTime>> + '_

Iterate over the transactions in the wallet.

+) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationBlockTime>> + '_

Iterate over the transactions in the wallet.

source

pub fn balance(&self) -> Balance

Return the balance, separated into available, trusted-pending, untrusted-pending and immature values.

source

pub fn add_signer( @@ -366,25 +366,25 @@ Otherwise, it will return the index of the highest address it has derived.

source

pub fn apply_update( &mut self, update: impl Into<Update> -) -> Result<(), CannotConnectError>

Applies an update to the wallet and stages the changes (but does not persist them).

+) -> Result<(), CannotConnectError>

Applies an update to the wallet and stages the changes (but does not persist them).

Usually you create an update by interacting with some blockchain data source and inserting transactions related to your wallet into it.

After applying updates you should persist the staged wallet changes. For an example of how to persist staged wallet changes see Wallet::reveal_next_address. `

source

pub fn staged(&self) -> Option<&ChangeSet>

Get a reference of the staged ChangeSet that are yet to be committed (if any).

source

pub fn take_staged(&mut self) -> Option<ChangeSet>

Take the staged ChangeSet to be persisted now (if any).

-
source

pub fn tx_graph(&self) -> &TxGraph<ConfirmationBlockTime>

Get a reference to the inner [TxGraph].

+
source

pub fn tx_graph(&self) -> &TxGraph<ConfirmationBlockTime>

Get a reference to the inner TxGraph.

source

pub fn unbroadcast_transactions( &self -) -> impl Iterator<Item = TxNode<'_, Arc<Transaction>, ConfirmationBlockTime>>

Iterate over transactions in the wallet that are unseen and unanchored likely +) -> impl Iterator<Item = TxNode<'_, Arc<Transaction>, ConfirmationBlockTime>>

Iterate over transactions in the wallet that are unseen and unanchored likely because they haven’t been broadcast.

-
source

pub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>

Get a reference to the inner [KeychainTxOutIndex].

-
source

pub fn local_chain(&self) -> &LocalChain

Get a reference to the inner [LocalChain].

+
source

pub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>

Get a reference to the inner KeychainTxOutIndex.

+
source

pub fn local_chain(&self) -> &LocalChain

Get a reference to the inner LocalChain.

source

pub fn apply_block( &mut self, block: &Block, height: u32 -) -> Result<(), CannotConnectError>

Introduces a block of height to the wallet, and tries to connect it to the +) -> Result<(), CannotConnectError>

Introduces a block of height to the wallet, and tries to connect it to the prev_blockhash of the block’s header.

This is a convenience method that is equivalent to calling apply_block_connected_to with prev_blockhash and height-1 as the connected_to parameter.

@@ -392,12 +392,12 @@ with prev_blockhash and height-1 as the connecte &mut self, block: &Block, height: u32, - connected_to: BlockId -) -> Result<(), ApplyHeaderError>

Applies relevant transactions from block of height to the wallet, and connects the + connected_to: BlockId +) -> Result<(), ApplyHeaderError>

Applies relevant transactions from block of height to the wallet, and connects the block to the internal chain.

The connected_to parameter informs the wallet how this block connects to the internal -[LocalChain]. Relevant transactions are filtered from the block and inserted into the -internal [TxGraph].

+LocalChain. Relevant transactions are filtered from the block and inserted into the +internal TxGraph.

WARNING: You must persist the changes resulting from one or more calls to this method if you need the inserted block data to be reloaded after closing the wallet. See Wallet::reveal_next_address.

@@ -414,44 +414,44 @@ when there is conflicting unconfirmed transactions. The transaction with the lat if you need the applied unconfirmed transactions to be reloaded after closing the wallet. See Wallet::reveal_next_address.

source§

impl Wallet

Methods to construct sync/full-scan requests for spk-based chain sources.

-
source

pub fn start_sync_with_revealed_spks(&self) -> SyncRequest

Create a partial [SyncRequest] for this wallet for all revealed spks.

+
source

pub fn start_sync_with_revealed_spks(&self) -> SyncRequest

Create a partial SyncRequest for this wallet for all revealed spks.

This is the first step when performing a spk-based wallet partial sync, the returned -[SyncRequest] collects all revealed script pubkeys from the wallet keychain needed to +SyncRequest collects all revealed script pubkeys from the wallet keychain needed to start a blockchain sync with a spk based blockchain client.

-
source

pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind>

Create a [`FullScanRequest] for this wallet.

+
source

pub fn start_full_scan(&self) -> FullScanRequest<KeychainKind>

Create a `FullScanRequest for this wallet.

This is the first step when performing a spk-based wallet full scan, the returned -[`FullScanRequest] collects iterators for the wallet’s keychain script pub keys needed to +`FullScanRequest collects iterators for the wallet’s keychain script pub keys needed to start a blockchain full scan with a spk based blockchain client.

This operation is generally only used when importing or restoring a previously used wallet in which the list of used scripts is not known.

-

Trait Implementations§

source§

impl AsRef<TxGraph<ConfirmationBlockTime>> for Wallet

source§

fn as_ref(&self) -> &TxGraph<ConfirmationBlockTime>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Wallet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PersistWith<Connection> for Wallet

§

type CreateParams = CreateParams

Parameters for [PersistWith::create].
§

type LoadParams = LoadParams

Parameters for [PersistWith::load].
§

type CreateError = CreateWithPersistError<Error>

Error type of [PersistWith::create].
§

type LoadError = LoadWithPersistError<Error>

Error type of [PersistWith::load].
§

type PersistError = Error

Error type of [PersistWith::persist].
source§

fn create( +

Trait Implementations§

source§

impl AsRef<TxGraph<ConfirmationBlockTime>> for Wallet

source§

fn as_ref(&self) -> &TxGraph<ConfirmationBlockTime>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Wallet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PersistWith<Connection> for Wallet

§

type CreateParams = CreateParams

Parameters for PersistWith::create.
§

type LoadParams = LoadParams

Parameters for PersistWith::load.
§

type CreateError = CreateWithPersistError<Error>

Error type of PersistWith::create.
§

type LoadError = LoadWithPersistError<Error>

Error type of PersistWith::load.
§

type PersistError = Error

Error type of PersistWith::persist.
source§

fn create( db: &mut Connection, - params: Self::CreateParams -) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( + params: Self::CreateParams +) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( db: &mut Connection, - params: Self::LoadParams -) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( + params: Self::LoadParams +) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( db: &mut Connection, - changeset: &<Self as Staged>::ChangeSet -) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl PersistWith<Store<ChangeSet>> for Wallet

§

type CreateParams = CreateParams

Parameters for [PersistWith::create].
§

type LoadParams = LoadParams

Parameters for [PersistWith::load].
§

type CreateError = CreateWithPersistError<Error>

Error type of [PersistWith::create].
§

type LoadError = LoadWithPersistError<AggregateChangesetsError<ChangeSet>>

Error type of [PersistWith::load].
§

type PersistError = Error

Error type of [PersistWith::persist].
source§

fn create( + changeset: &<Self as Staged>::ChangeSet +) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl PersistWith<Store<ChangeSet>> for Wallet

§

type CreateParams = CreateParams

Parameters for PersistWith::create.
§

type LoadParams = LoadParams

Parameters for PersistWith::load.
§

type CreateError = CreateWithPersistError<Error>

Error type of PersistWith::create.
§

type LoadError = LoadWithPersistError<AggregateChangesetsError<ChangeSet>>

Error type of PersistWith::load.
§

type PersistError = Error

Error type of PersistWith::persist.
source§

fn create( db: &mut Store<ChangeSet>, - params: Self::CreateParams -) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( + params: Self::CreateParams +) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( db: &mut Store<ChangeSet>, - params: Self::LoadParams -) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( + params: Self::LoadParams +) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( db: &mut Store<ChangeSet>, - changeset: &<Self as Staged>::ChangeSet -) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl<'c> PersistWith<Transaction<'c>> for Wallet

§

type CreateParams = CreateParams

Parameters for [PersistWith::create].
§

type LoadParams = LoadParams

Parameters for [PersistWith::load].
§

type CreateError = CreateWithPersistError<Error>

Error type of [PersistWith::create].
§

type LoadError = LoadWithPersistError<Error>

Error type of [PersistWith::load].
§

type PersistError = Error

Error type of [PersistWith::persist].
source§

fn create( + changeset: &<Self as Staged>::ChangeSet +) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl<'c> PersistWith<Transaction<'c>> for Wallet

§

type CreateParams = CreateParams

Parameters for PersistWith::create.
§

type LoadParams = LoadParams

Parameters for PersistWith::load.
§

type CreateError = CreateWithPersistError<Error>

Error type of PersistWith::create.
§

type LoadError = LoadWithPersistError<Error>

Error type of PersistWith::load.
§

type PersistError = Error

Error type of PersistWith::persist.
source§

fn create( db: &mut Transaction<'c>, - params: Self::CreateParams -) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( + params: Self::CreateParams +) -> Result<Self, Self::CreateError>

Initialize the Db and create Self.
source§

fn load( conn: &mut Transaction<'c>, - params: Self::LoadParams -) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( + params: Self::LoadParams +) -> Result<Option<Self>, Self::LoadError>

Initialize the Db and load a previously-persisted Self.
source§

fn persist( db: &mut Transaction<'c>, - changeset: &<Self as Staged>::ChangeSet -) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl Staged for Wallet

§

type ChangeSet = ChangeSet

Type for staged changes.
source§

fn staged(&mut self) -> &mut Self::ChangeSet

Get mutable reference of staged changes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + changeset: &<Self as Staged>::ChangeSet +) -> Result<(), Self::PersistError>

Persist changes to the Db.
source§

impl Staged for Wallet

§

type ChangeSet = ChangeSet

Type for staged changes.
source§

fn staged(&mut self) -> &mut Self::ChangeSet

Get mutable reference of staged changes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/type.PersistedWallet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/type.PersistedWallet.html index b5ec9c3c3d..f7c9aba424 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/type.PersistedWallet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_wallet/type.PersistedWallet.html @@ -1,2 +1,2 @@ -PersistedWallet in bdk_wallet - Rust

Type Alias bdk_wallet::PersistedWallet

source ·
pub type PersistedWallet = Persisted<Wallet>;
Expand description

Represents a persisted wallet.

+PersistedWallet in bdk_wallet - Rust

Type Alias bdk_wallet::PersistedWallet

source ·
pub type PersistedWallet = Persisted<Wallet>;
Expand description

Represents a persisted wallet.

Aliased Type§

struct PersistedWallet { /* private fields */ }
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html index 82ba32e031..376264b1de 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html @@ -1,4 +1,4 @@ -create_tx in example_cli - Rust

Function example_cli::create_tx

source ·
pub fn create_tx<O: ChainOracle>(
+create_tx in example_cli - Rust

Function example_cli::create_tx

source ·
pub fn create_tx<O: ChainOracle>(
     graph: &mut KeychainTxGraph,
     chain: &O,
     assets: &Assets,
@@ -6,4 +6,4 @@
     address: Address,
     value: u64
 ) -> Result<(Psbt, Option<ChangeInfo>)>
where - O::Error: Error + Send + Sync + 'static,
\ No newline at end of file + O::Error: Error + Send + Sync + 'static,
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html index abda0c9fdf..9c737b3b83 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html @@ -1,6 +1,6 @@ handle_commands in example_cli - Rust

Function example_cli::handle_commands

source ·
pub fn handle_commands<CS: Subcommand, S: Args>(
     graph: &Mutex<KeychainTxGraph>,
-    chain: &Mutex<LocalChain>,
+    chain: &Mutex<LocalChain>,
     db: &Mutex<Store<ChangeSet>>,
     network: Network,
     broadcast: impl FnOnce(S, &Transaction) -> Result<()>,
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html
index 00edc61337..4d00ba22bc 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html
@@ -1,5 +1,5 @@
-planned_utxos in example_cli - Rust

Function example_cli::planned_utxos

source ·
pub fn planned_utxos<O: ChainOracle>(
+planned_utxos in example_cli - Rust

Function example_cli::planned_utxos

source ·
pub fn planned_utxos<O: ChainOracle>(
     graph: &KeychainTxGraph,
     chain: &O,
     assets: &Assets
-) -> Result<Vec<PlanUtxo>, O::Error>
\ No newline at end of file +) -> Result<Vec<PlanUtxo>, O::Error>
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeInfo.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeInfo.html index 697f7f3e85..75e4a501b8 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeInfo.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeInfo.html @@ -1,8 +1,8 @@ ChangeInfo in example_cli - Rust

Struct example_cli::ChangeInfo

source ·
pub struct ChangeInfo {
     pub change_keychain: Keychain,
-    pub indexer: ChangeSet,
+    pub indexer: ChangeSet,
     pub index: u32,
-}

Fields§

§change_keychain: Keychain§indexer: ChangeSet§index: u32

Trait Implementations§

source§

impl Debug for ChangeInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Fields§

§change_keychain: Keychain§indexer: ChangeSet§index: u32

Trait Implementations§

source§

impl Debug for ChangeInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeSet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeSet.html index f07b132ef1..cd4676a4d9 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeSet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.ChangeSet.html @@ -2,18 +2,18 @@ pub descriptor: Option<Descriptor<DescriptorPublicKey>>, pub change_descriptor: Option<Descriptor<DescriptorPublicKey>>, pub network: Option<Network>, - pub local_chain: ChangeSet, - pub tx_graph: ChangeSet<ConfirmationBlockTime>, - pub indexer: ChangeSet, + pub local_chain: ChangeSet, + pub tx_graph: ChangeSet<ConfirmationBlockTime>, + pub indexer: ChangeSet, }
Expand description

ChangeSet

Fields§

§descriptor: Option<Descriptor<DescriptorPublicKey>>

Descriptor for recipient addresses.

§change_descriptor: Option<Descriptor<DescriptorPublicKey>>

Descriptor for change addresses.

§network: Option<Network>

Stores the network type of the transaction data.

-
§local_chain: ChangeSet

Changes to the [LocalChain].

-
§tx_graph: ChangeSet<ConfirmationBlockTime>

Changes to TxGraph.

-
§indexer: ChangeSet

Changes to [KeychainTxOutIndex].

+
§local_chain: ChangeSet

Changes to the LocalChain.

+
§tx_graph: ChangeSet<ConfirmationBlockTime>

Changes to TxGraph.

+
§indexer: ChangeSet

Changes to KeychainTxOutIndex.

Trait Implementations§

source§

impl Clone for ChangeSet

source§

fn clone(&self) -> ChangeSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ChangeSet

source§

fn default() -> ChangeSet

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ChangeSet

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Merge for ChangeSet

source§

fn merge(&mut self, other: Self)

Merge another object of the same type onto self.
source§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
source§

impl PartialEq for ChangeSet

source§

fn eq(&self, other: &ChangeSet) -> bool

This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§

impl Merge for ChangeSet

source§

fn merge(&mut self, other: Self)

Merge another object of the same type onto self.
source§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
source§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
source§

impl PartialEq for ChangeSet

source§

fn eq(&self, other: &ChangeSet) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ChangeSet

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ChangeSet

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html index 776f100753..0f7b128436 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html @@ -1,13 +1,13 @@ Init in example_cli - Rust

Struct example_cli::Init

source ·
pub struct Init<CS: Subcommand, S: Args> {
     pub args: Args<CS, S>,
     pub graph: Mutex<KeychainTxGraph>,
-    pub chain: Mutex<LocalChain>,
+    pub chain: Mutex<LocalChain>,
     pub db: Mutex<Store<ChangeSet>>,
     pub network: Network,
 }
Expand description

The initial state returned by init_or_load.

Fields§

§args: Args<CS, S>

CLI args

§graph: Mutex<KeychainTxGraph>

Indexed graph

-
§chain: Mutex<LocalChain>

Local chain

+
§chain: Mutex<LocalChain>

Local chain

§db: Mutex<Store<ChangeSet>>

Database

§network: Network

Network

Auto Trait Implementations§

§

impl<CS, S> !Freeze for Init<CS, S>

§

impl<CS, S> RefUnwindSafe for Init<CS, S>
where diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html index 5c47577fae..c03df25442 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html @@ -1,6 +1,6 @@ -KeychainTxGraph in example_cli - Rust

Type Alias example_cli::KeychainTxGraph

source ·
pub type KeychainTxGraph = IndexedTxGraph<ConfirmationBlockTime, KeychainTxOutIndex<Keychain>>;
Expand description

Alias for a IndexedTxGraph with specific Anchor and Indexer.

+KeychainTxGraph in example_cli - Rust

Type Alias example_cli::KeychainTxGraph

source ·
pub type KeychainTxGraph = IndexedTxGraph<ConfirmationBlockTime, KeychainTxOutIndex<Keychain>>;
Expand description

Alias for a IndexedTxGraph with specific Anchor and Indexer.

Aliased Type§

struct KeychainTxGraph {
-    pub index: KeychainTxOutIndex<Keychain>,
+    pub index: KeychainTxOutIndex<Keychain>,
     /* private fields */
-}

Fields§

§index: KeychainTxOutIndex<Keychain>

Transaction index.

+}

Fields§

§index: KeychainTxOutIndex<Keychain>

Transaction index.

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.PlanUtxo.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.PlanUtxo.html index 920fd3240c..badfea5866 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.PlanUtxo.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.PlanUtxo.html @@ -1 +1 @@ -PlanUtxo in example_cli - Rust

Type Alias example_cli::PlanUtxo

source ·
pub type PlanUtxo = (Plan, FullTxOut<ConfirmationBlockTime>);
\ No newline at end of file +PlanUtxo in example_cli - Rust

Type Alias example_cli::PlanUtxo

source ·
pub type PlanUtxo = (Plan, FullTxOut<ConfirmationBlockTime>);
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html index 08ff977b9d..116e4c6e76 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html @@ -1 +1 @@ -Help

Rustdoc help

Back
\ No newline at end of file +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html index d75e264032..d9d3b0bc4b 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html @@ -1 +1 @@ -Settings

Rustdoc settings

Back
\ No newline at end of file +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.PersistWith.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.PersistWith.js index f6b21a7527..eb11aadc0c 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.PersistWith.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.PersistWith.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"bdk_wallet":[["impl PersistWith<Connection> for Wallet"],["impl PersistWith<Store<ChangeSet>> for Wallet"],["impl<'c> PersistWith<Transaction<'c>> for Wallet"]] +"bdk_wallet":[["impl PersistWith<Connection> for Wallet"],["impl PersistWith<Store<ChangeSet>> for Wallet"],["impl<'c> PersistWith<Transaction<'c>> for Wallet"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.Staged.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.Staged.js index 16e5aea7d6..971a74895b 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.Staged.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/persist/trait.Staged.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"bdk_wallet":[["impl Staged for Wallet"]] +"bdk_wallet":[["impl Staged for Wallet"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Merge.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Merge.js index a543ed209b..2ac90a8a74 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Merge.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Merge.js @@ -1,5 +1,5 @@ (function() {var implementors = { "bdk_chain":[], -"bdk_wallet":[["impl Merge for ChangeSet"]], -"example_cli":[["impl Merge for ChangeSet"]] +"bdk_wallet":[["impl Merge for ChangeSet"]], +"example_cli":[["impl Merge for ChangeSet"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js index a54eb9a2cf..f85fedae4e 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js @@ -1,4 +1,4 @@ (function() {var implementors = { "bdk_chain":[["impl AsRef<[u8; 32]> for DescriptorId"],["impl AsRef<[u8]> for DescriptorId"],["impl<A> AsRef<TxGraph<A>> for TxGraph<A>"],["impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>"]], -"bdk_wallet":[["impl AsRef<TxGraph<ConfirmationBlockTime>> for Wallet"],["impl AsRef<[u8]> for KeychainKind"]] +"bdk_wallet":[["impl AsRef<TxGraph<ConfirmationBlockTime>> for Wallet"],["impl AsRef<[u8]> for KeychainKind"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js index b6b8472d74..f43b972e00 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_chain":[["impl From<(&u32, &BlockHash)> for BlockId"],["impl From<(u32, BlockHash)> for BlockId"],["impl From<ChainPosition<ConfirmationBlockTime>> for ConfirmationTime"],["impl From<BlockId> for (u32, BlockHash)"],["impl From<DescriptorId> for Hash"],["impl From<Hash> for DescriptorId"],["impl<A> From<ChangeSet> for ChangeSet<A, ChangeSet>"],["impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>"],["impl<B: IntoIterator<Item = (u32, Option<BlockHash>)>> From<B> for ChangeSet"],["impl<T> From<T> for Impl<T>"]], "bdk_file_store":[["impl From<Error> for FileError"],["impl From<Error> for IterError"]], -"bdk_wallet":[["impl From<Error> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<PolicyError> for Error"],["impl From<PolicyError> for CreateTxError"],["impl From<SatisfiableItem> for Policy"],["impl From<LoadMismatch> for LoadError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<KeyError> for Error"],["impl From<bool> for Satisfaction"],["impl From<ChangeSet> for ChangeSet"],["impl From<ChangeSet> for ChangeSet"],["impl From<ChangeSet<ConfirmationBlockTime>> for ChangeSet"],["impl From<ChangeSet<ConfirmationBlockTime, ChangeSet>> for ChangeSet"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for CreateTxError"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Fingerprint> for SignerId"],["impl From<FullScanResult<KeychainKind>> for Update"],["impl From<Hash> for SignerId"],["impl From<HexToBytesError> for Error"],["impl From<ParsePublicKeyError> for Error"],["impl From<SyncResult> for Update"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"],["impl<E> From<LoadMismatch> for LoadWithPersistError<E>"]], +"bdk_wallet":[["impl From<Error> for CreateTxError"],["impl From<Error> for CreateTxError"],["impl From<PolicyError> for Error"],["impl From<PolicyError> for CreateTxError"],["impl From<SatisfiableItem> for Policy"],["impl From<LoadMismatch> for LoadError"],["impl From<MiniscriptPsbtError> for CreateTxError"],["impl From<KeyError> for Error"],["impl From<bool> for Satisfaction"],["impl From<ChangeSet<ConfirmationBlockTime, ChangeSet>> for ChangeSet"],["impl From<ChangeSet> for ChangeSet"],["impl From<ChangeSet> for ChangeSet"],["impl From<FullScanResult<KeychainKind>> for Update"],["impl From<SyncResult> for Update"],["impl From<ChangeSet<ConfirmationBlockTime>> for ChangeSet"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for CreateTxError"],["impl From<Error> for KeyError"],["impl From<Error> for KeyError"],["impl From<Fingerprint> for SignerId"],["impl From<Hash> for SignerId"],["impl From<HexToBytesError> for Error"],["impl From<ParsePublicKeyError> for Error"],["impl<Ctx: ScriptContext> From<Xpriv> for ExtendedKey<Ctx>"],["impl<Ctx: ScriptContext> From<Xpub> for ExtendedKey<Ctx>"],["impl<E> From<LoadMismatch> for LoadWithPersistError<E>"]], "example_bitcoind_rpc_polling":[["impl From<RpcArgs> for Auth"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js index 7f2a5f8124..8fad46bc07 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"bdk_wallet":[["
source§

impl<K, V> BTreeMap<K, V>

1.0.0 (const: 1.66.0) · source

pub const fn new() -> BTreeMap<K, V>

Makes a new, empty BTreeMap.

\n

Does not allocate anything on its own.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn iter(&self) -> Iter<'_, K, V>

Gets an iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Gets a mutable iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
\n
1.0.0 · source

pub fn keys(&self) -> Keys<'_, K, V>

Gets an iterator over the keys of the map, in sorted order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
\n
1.0.0 · source

pub fn values(&self) -> Values<'_, K, V>

Gets an iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
1.10.0 · source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

Gets a mutable iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
\n
1.0.0 (const: unstable) · source

pub fn len(&self) -> usize

Returns the number of elements in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert_eq!(a.len(), 0);\na.insert(1, \"a\");\nassert_eq!(a.len(), 1);
\n
1.0.0 (const: unstable) · source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert!(a.is_empty());\na.insert(1, \"a\");\nassert!(!a.is_empty());
\n
source

pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
\n
source

pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
\n
source

pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
source

pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn clear(&mut self)

Clears the map, removing all elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.clear();\nassert!(a.is_empty());
\n
source

pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

🔬This is a nightly-only experimental API. (btreemap_alloc)

Makes a new empty BTreeMap with a reasonable choice for B.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get(&1), Some(&\"a\"));\nassert_eq!(map.get(&2), None);
\n
1.40.0 · source

pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns the key-value pair corresponding to the supplied key.

\n

The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get_key_value(&1), Some((&1, &\"a\")));\nassert_eq!(map.get_key_value(&2), None);
\n
1.66.0 · source

pub fn first_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.first_key_value(), None);\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.first_key_value(), Some((&1, &\"b\")));
\n
1.66.0 · source

pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
\n
1.66.0 · source

pub fn pop_first(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

\n
§Examples
\n

Draining elements in ascending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
\n
1.66.0 · source

pub fn last_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
\n
1.66.0 · source

pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
\n
1.66.0 · source

pub fn pop_last(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

\n
§Examples
\n

Draining elements in descending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
\n
1.0.0 · source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns true if the map contains a value for the specified key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.contains_key(&1), true);\nassert_eq!(map.contains_key(&2), false);
\n
1.0.0 · source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a mutable reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nif let Some(x) = map.get_mut(&1) {\n    *x = \"b\";\n}\nassert_eq!(map[&1], \"b\");
\n
1.0.0 · source

pub fn insert(&mut self, key: K, value: V) -> Option<V>
where\n K: Ord,

Inserts a key-value pair into the map.

\n

If the map did not have this key present, None is returned.

\n

If the map did have this key present, the value is updated, and the old\nvalue is returned. The key is not updated, though; this matters for\ntypes that can be == without being identical. See the module-level\ndocumentation for more.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.insert(37, \"a\"), None);\nassert_eq!(map.is_empty(), false);\n\nmap.insert(37, \"b\");\nassert_eq!(map.insert(37, \"c\"), Some(\"b\"));\nassert_eq!(map[&37], \"c\");
\n
source

pub fn try_insert(\n &mut self,\n key: K,\n value: V\n) -> Result<&mut V, OccupiedError<'_, K, V, A>>
where\n K: Ord,

🔬This is a nightly-only experimental API. (map_try_insert)

Tries to insert a key-value pair into the map, and returns\na mutable reference to the value in the entry.

\n

If the map already had this key present, nothing is updated, and\nan error containing the occupied entry and the value is returned.

\n
§Examples
\n
#![feature(map_try_insert)]\n\nuse std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.try_insert(37, \"a\").unwrap(), &\"a\");\n\nlet err = map.try_insert(37, \"b\").unwrap_err();\nassert_eq!(err.entry.key(), &37);\nassert_eq!(err.entry.get(), &\"a\");\nassert_eq!(err.value, \"b\");
\n
1.0.0 · source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the value at the key if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove(&1), Some(\"a\"));\nassert_eq!(map.remove(&1), None);
\n
1.45.0 · source

pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the stored key and value if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove_entry(&1), Some((1, \"a\")));\nassert_eq!(map.remove_entry(&1), None);
\n
1.53.0 · source

pub fn retain<F>(&mut self, f: F)
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.\nThe elements are visited in ascending key order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
\n
1.11.0 · source

pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
where\n K: Ord,\n A: Clone,

Moves all elements from other into self, leaving other empty.

\n

If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
\n
1.17.0 · source

pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
\n
1.17.0 · source

pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
\n
1.0.0 · source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
where\n K: Ord,

Gets the given key’s corresponding entry in the map for in-place manipulation.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
\n
1.11.0 · source

pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
\n
source

pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A>
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

🔬This is a nightly-only experimental API. (btree_extract_if)

Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

\n

The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n
§Examples
\n

Splitting a map into even and odd keys, reusing the original map:

\n\n
#![feature(btree_extract_if)]\nuse std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();\nlet evens: BTreeMap<_, _> = map.extract_if(|k, _v| k % 2 == 0).collect();\nlet odds = map;\nassert_eq!(evens.keys().copied().collect::<Vec<_>>(), [0, 2, 4, 6]);\nassert_eq!(odds.keys().copied().collect::<Vec<_>>(), [1, 3, 5, 7]);
\n
1.54.0 · source

pub fn into_keys(self) -> IntoKeys<K, V, A>

Creates a consuming iterator visiting all the keys, in sorted order.\nThe map cannot be used after calling this.\nThe iterator element type is K.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
\n
1.54.0 · source

pub fn into_values(self) -> IntoValues<K, V, A>

Creates a consuming iterator visiting all the values, in order by key.\nThe map cannot be used after calling this.\nThe iterator element type is V.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Clone for BTreeMap<K, V, A>
where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

source§

fn clone(&self) -> BTreeMap<K, V, A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Debug for BTreeMap<K, V, A>
where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V> Default for BTreeMap<K, V>

source§

fn default() -> BTreeMap<K, V>

Creates an empty BTreeMap.

\n
","Default","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<BTreeMap<K, V>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.7.0 · source§

impl<K, V, A> Drop for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.2.0 · source§

impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (&'a K, &'a V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(&'a K, &'a V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
where\n K: Ord,\n A: Allocator + Clone,

source§

fn extend<T>(&mut self, iter: T)
where\n T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (K, V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.56.0 · source§

impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from(arr: [(K, V); N]) -> BTreeMap<K, V>

Converts a [(K, V); N] into a BTreeMap<(K, V)>.

\n\n
use std::collections::BTreeMap;\n\nlet map1 = BTreeMap::from([(1, 2), (3, 4)]);\nlet map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
\n
","From<[(K, V); N]>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from_iter<T>(iter: T) -> BTreeMap<K, V>
where\n T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
","FromIterator<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Hash for BTreeMap<K, V, A>
where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

source§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

\n
§Panics
\n

Panics if the key is not present in the BTreeMap.

\n
§

type Output = V

The returned type after indexing.
","Index<&Q>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
§

impl IntoAssets for BTreeMap<DescriptorPublicKey, DescriptorSecretKey>

§

fn into_assets(self) -> Assets

Convert self into a Assets struct
","IntoAssets","bdk_wallet::keys::KeyMap"],["
source§

impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

§

type Deserializer = MapDeserializer<'de, <BTreeMap<K, V> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(\n self\n) -> <BTreeMap<K, V> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn into_iter(self) -> IntoIter<K, V, A>

Gets an owning iterator over the entries of the map, sorted by key.

\n
§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, A>

Which kind of iterator are we turning this into?
","IntoIterator","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
§

impl<K, V> Merge for BTreeMap<K, V>
where\n K: Ord,

§

fn merge(&mut self, other: BTreeMap<K, V>)

Merge another object of the same type onto self.
§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
","Merge","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Ord for BTreeMap<K, V, A>
where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

source§

fn cmp(&self, other: &BTreeMap<K, V, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> PartialEq for BTreeMap<K, V, A>
where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

source§

fn eq(&self, other: &BTreeMap<K, V, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

source§

fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V> Serialize for BTreeMap<K, V>
where\n K: Serialize,\n V: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Eq for BTreeMap<K, V, A>
where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

","Eq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.64.0 · source§

impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

","UnwindSafe","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"]] +"bdk_wallet":[["
source§

impl<K, V> BTreeMap<K, V>

1.0.0 (const: 1.66.0) · source

pub const fn new() -> BTreeMap<K, V>

Makes a new, empty BTreeMap.

\n

Does not allocate anything on its own.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn iter(&self) -> Iter<'_, K, V>

Gets an iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Gets a mutable iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
\n
1.0.0 · source

pub fn keys(&self) -> Keys<'_, K, V>

Gets an iterator over the keys of the map, in sorted order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
\n
1.0.0 · source

pub fn values(&self) -> Values<'_, K, V>

Gets an iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
1.10.0 · source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

Gets a mutable iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
\n
1.0.0 (const: unstable) · source

pub fn len(&self) -> usize

Returns the number of elements in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert_eq!(a.len(), 0);\na.insert(1, \"a\");\nassert_eq!(a.len(), 1);
\n
1.0.0 (const: unstable) · source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert!(a.is_empty());\na.insert(1, \"a\");\nassert!(!a.is_empty());
\n
source

pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
\n
source

pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
\n
source

pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
source

pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn clear(&mut self)

Clears the map, removing all elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.clear();\nassert!(a.is_empty());
\n
source

pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

🔬This is a nightly-only experimental API. (btreemap_alloc)

Makes a new empty BTreeMap with a reasonable choice for B.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get(&1), Some(&\"a\"));\nassert_eq!(map.get(&2), None);
\n
1.40.0 · source

pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns the key-value pair corresponding to the supplied key.

\n

The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get_key_value(&1), Some((&1, &\"a\")));\nassert_eq!(map.get_key_value(&2), None);
\n
1.66.0 · source

pub fn first_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.first_key_value(), None);\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.first_key_value(), Some((&1, &\"b\")));
\n
1.66.0 · source

pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
\n
1.66.0 · source

pub fn pop_first(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

\n
§Examples
\n

Draining elements in ascending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
\n
1.66.0 · source

pub fn last_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
\n
1.66.0 · source

pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
\n
1.66.0 · source

pub fn pop_last(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

\n
§Examples
\n

Draining elements in descending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
\n
1.0.0 · source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns true if the map contains a value for the specified key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.contains_key(&1), true);\nassert_eq!(map.contains_key(&2), false);
\n
1.0.0 · source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a mutable reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nif let Some(x) = map.get_mut(&1) {\n    *x = \"b\";\n}\nassert_eq!(map[&1], \"b\");
\n
1.0.0 · source

pub fn insert(&mut self, key: K, value: V) -> Option<V>
where\n K: Ord,

Inserts a key-value pair into the map.

\n

If the map did not have this key present, None is returned.

\n

If the map did have this key present, the value is updated, and the old\nvalue is returned. The key is not updated, though; this matters for\ntypes that can be == without being identical. See the module-level\ndocumentation for more.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.insert(37, \"a\"), None);\nassert_eq!(map.is_empty(), false);\n\nmap.insert(37, \"b\");\nassert_eq!(map.insert(37, \"c\"), Some(\"b\"));\nassert_eq!(map[&37], \"c\");
\n
source

pub fn try_insert(\n &mut self,\n key: K,\n value: V\n) -> Result<&mut V, OccupiedError<'_, K, V, A>>
where\n K: Ord,

🔬This is a nightly-only experimental API. (map_try_insert)

Tries to insert a key-value pair into the map, and returns\na mutable reference to the value in the entry.

\n

If the map already had this key present, nothing is updated, and\nan error containing the occupied entry and the value is returned.

\n
§Examples
\n
#![feature(map_try_insert)]\n\nuse std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.try_insert(37, \"a\").unwrap(), &\"a\");\n\nlet err = map.try_insert(37, \"b\").unwrap_err();\nassert_eq!(err.entry.key(), &37);\nassert_eq!(err.entry.get(), &\"a\");\nassert_eq!(err.value, \"b\");
\n
1.0.0 · source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the value at the key if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove(&1), Some(\"a\"));\nassert_eq!(map.remove(&1), None);
\n
1.45.0 · source

pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the stored key and value if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove_entry(&1), Some((1, \"a\")));\nassert_eq!(map.remove_entry(&1), None);
\n
1.53.0 · source

pub fn retain<F>(&mut self, f: F)
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.\nThe elements are visited in ascending key order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
\n
1.11.0 · source

pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
where\n K: Ord,\n A: Clone,

Moves all elements from other into self, leaving other empty.

\n

If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
\n
1.17.0 · source

pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
\n
1.17.0 · source

pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
\n
1.0.0 · source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
where\n K: Ord,

Gets the given key’s corresponding entry in the map for in-place manipulation.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
\n
1.11.0 · source

pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
\n
source

pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A>
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

🔬This is a nightly-only experimental API. (btree_extract_if)

Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

\n

The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n
§Examples
\n

Splitting a map into even and odd keys, reusing the original map:

\n\n
#![feature(btree_extract_if)]\nuse std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();\nlet evens: BTreeMap<_, _> = map.extract_if(|k, _v| k % 2 == 0).collect();\nlet odds = map;\nassert_eq!(evens.keys().copied().collect::<Vec<_>>(), [0, 2, 4, 6]);\nassert_eq!(odds.keys().copied().collect::<Vec<_>>(), [1, 3, 5, 7]);
\n
1.54.0 · source

pub fn into_keys(self) -> IntoKeys<K, V, A>

Creates a consuming iterator visiting all the keys, in sorted order.\nThe map cannot be used after calling this.\nThe iterator element type is K.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
\n
1.54.0 · source

pub fn into_values(self) -> IntoValues<K, V, A>

Creates a consuming iterator visiting all the values, in order by key.\nThe map cannot be used after calling this.\nThe iterator element type is V.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Clone for BTreeMap<K, V, A>
where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

source§

fn clone(&self) -> BTreeMap<K, V, A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Debug for BTreeMap<K, V, A>
where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V> Default for BTreeMap<K, V>

source§

fn default() -> BTreeMap<K, V>

Creates an empty BTreeMap.

\n
","Default","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<BTreeMap<K, V>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.7.0 · source§

impl<K, V, A> Drop for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.2.0 · source§

impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (&'a K, &'a V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(&'a K, &'a V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
where\n K: Ord,\n A: Allocator + Clone,

source§

fn extend<T>(&mut self, iter: T)
where\n T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (K, V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.56.0 · source§

impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from(arr: [(K, V); N]) -> BTreeMap<K, V>

Converts a [(K, V); N] into a BTreeMap<(K, V)>.

\n\n
use std::collections::BTreeMap;\n\nlet map1 = BTreeMap::from([(1, 2), (3, 4)]);\nlet map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
\n
","From<[(K, V); N]>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from_iter<T>(iter: T) -> BTreeMap<K, V>
where\n T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
","FromIterator<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Hash for BTreeMap<K, V, A>
where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

source§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

\n
§Panics
\n

Panics if the key is not present in the BTreeMap.

\n
§

type Output = V

The returned type after indexing.
","Index<&Q>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
§

impl IntoAssets for BTreeMap<DescriptorPublicKey, DescriptorSecretKey>

§

fn into_assets(self) -> Assets

Convert self into a Assets struct
","IntoAssets","bdk_wallet::keys::KeyMap"],["
source§

impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

§

type Deserializer = MapDeserializer<'de, <BTreeMap<K, V> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(\n self\n) -> <BTreeMap<K, V> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn into_iter(self) -> IntoIter<K, V, A>

Gets an owning iterator over the entries of the map, sorted by key.

\n
§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, A>

Which kind of iterator are we turning this into?
","IntoIterator","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V> Merge for BTreeMap<K, V>
where\n K: Ord,

source§

fn merge(&mut self, other: BTreeMap<K, V>)

Merge another object of the same type onto self.
source§

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.
source§

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.
","Merge","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Ord for BTreeMap<K, V, A>
where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

source§

fn cmp(&self, other: &BTreeMap<K, V, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> PartialEq for BTreeMap<K, V, A>
where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

source§

fn eq(&self, other: &BTreeMap<K, V, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

source§

fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
source§

impl<K, V> Serialize for BTreeMap<K, V>
where\n K: Serialize,\n V: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.0.0 · source§

impl<K, V, A> Eq for BTreeMap<K, V, A>
where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

","Eq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
1.64.0 · source§

impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

","UnwindSafe","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js index 8ab34b1526..2f94667f00 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"example_cli":[["
§

impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>

§

fn as_ref(&self) -> &TxGraph<A>

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef>","example_cli::KeychainTxGraph"],["
§

impl<A, I> Debug for IndexedTxGraph<A, I>
where\n A: Debug,\n I: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","example_cli::KeychainTxGraph"],["
§

impl<A, I> Default for IndexedTxGraph<A, I>
where\n I: Default,

§

fn default() -> IndexedTxGraph<A, I>

Returns the “default value” for a type. Read more
","Default","example_cli::KeychainTxGraph"],["
§

impl<A, I> IndexedTxGraph<A, I>

pub fn new(index: I) -> IndexedTxGraph<A, I>

Construct a new [IndexedTxGraph] with a given index.

\n

pub fn graph(&self) -> &TxGraph<A>

Get a reference of the internal transaction graph.

\n
",0,"example_cli::KeychainTxGraph"],["
§

impl<A, I> IndexedTxGraph<A, I>
where\n A: Anchor + AnchorFromBlockPosition,\n I: Indexer,\n <I as Indexer>::ChangeSet: Default + Merge,

Methods are available if the anchor (A) implements [AnchorFromBlockPosition].

\n

pub fn apply_block_relevant(\n &mut self,\n block: &Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert all transactions of the given block of height, filtering out those that are\nirrelevant.

\n

Each inserted transaction’s anchor will be constructed from\n[AnchorFromBlockPosition::from_block_position].

\n

Relevancy is determined by the internal [Indexer::is_tx_relevant] implementation of I.\nIrrelevant transactions in txs will be ignored.

\n

pub fn apply_block(\n &mut self,\n block: Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert all transactions of the given block of height.

\n

Each inserted transaction’s anchor will be constructed from\n[AnchorFromBlockPosition::from_block_position].

\n

To only insert relevant transactions, use apply_block_relevant instead.

\n
",0,"example_cli::KeychainTxGraph"],["
§

impl<A, I> IndexedTxGraph<A, I>
where\n A: Anchor,\n I: Indexer,

pub fn apply_changeset(\n &mut self,\n changeset: ChangeSet<A, <I as Indexer>::ChangeSet>\n)

Applies the [ChangeSet] to the [IndexedTxGraph].

\n

pub fn initial_changeset(&self) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Determines the [ChangeSet] between self and an empty [IndexedTxGraph].

\n
",0,"example_cli::KeychainTxGraph"],["
§

impl<A, I> IndexedTxGraph<A, I>
where\n A: Anchor,\n I: Indexer,\n <I as Indexer>::ChangeSet: Default + Merge,

pub fn apply_update(\n &mut self,\n update: TxGraph<A>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Apply an update directly.

\n

update is a [TxGraph<A>] and the resultant changes is returned as [ChangeSet].

\n

pub fn insert_txout(\n &mut self,\n outpoint: OutPoint,\n txout: TxOut\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert a floating txout of given outpoint.

\n

pub fn insert_tx(\n &mut self,\n tx: Transaction\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert and index a transaction into the graph.

\n

pub fn insert_anchor(\n &mut self,\n txid: Txid,\n anchor: A\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert an anchor for a given transaction.

\n

pub fn insert_seen_at(\n &mut self,\n txid: Txid,\n seen_at: u64\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert a unix timestamp of when a transaction is seen in the mempool.

\n

This is used for transaction conflict resolution in [TxGraph] where the transaction with\nthe later last-seen is prioritized.

\n

pub fn batch_insert_relevant<'t>(\n &mut self,\n txs: impl IntoIterator<Item = (&'t Transaction, impl IntoIterator<Item = A>)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert transactions, filtering out those that are irrelevant.

\n

Relevancy is determined by the [Indexer::is_tx_relevant] implementation of I. Irrelevant\ntransactions in txs will be ignored. txs do not need to be in topological order.

\n

pub fn batch_insert_relevant_unconfirmed<'t>(\n &mut self,\n unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert unconfirmed transactions, filtering out those that are irrelevant.

\n

Relevancy is determined by the internal [Indexer::is_tx_relevant] implementation of I.\nIrrelevant transactions in txs will be ignored.

\n

Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in [TxGraph] (refer to [TxGraph::insert_seen_at] for details).

\n

pub fn batch_insert_unconfirmed(\n &mut self,\n txs: impl IntoIterator<Item = (Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert unconfirmed transactions.

\n

Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in [TxGraph] (refer to [TxGraph::insert_seen_at] for details).

\n

To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

\n
",0,"example_cli::KeychainTxGraph"]] +"example_cli":[["
source§

impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>

source§

fn as_ref(&self) -> &TxGraph<A>

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef>","example_cli::KeychainTxGraph"],["
source§

impl<A, I> Debug for IndexedTxGraph<A, I>
where\n A: Debug,\n I: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","example_cli::KeychainTxGraph"],["
source§

impl<A, I> Default for IndexedTxGraph<A, I>
where\n I: Default,

source§

fn default() -> IndexedTxGraph<A, I>

Returns the “default value” for a type. Read more
","Default","example_cli::KeychainTxGraph"],["
source§

impl<A, I> IndexedTxGraph<A, I>

Methods are available if the anchor (A) implements AnchorFromBlockPosition.

\n
source

pub fn apply_block_relevant(\n &mut self,\n block: &Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert all transactions of the given block of height, filtering out those that are\nirrelevant.

\n

Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

\n

Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

\n
source

pub fn apply_block(\n &mut self,\n block: Block,\n height: u32\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert all transactions of the given block of height.

\n

Each inserted transaction’s anchor will be constructed from\nAnchorFromBlockPosition::from_block_position.

\n

To only insert relevant transactions, use apply_block_relevant instead.

\n
",0,"example_cli::KeychainTxGraph"],["
source§

impl<A, I> IndexedTxGraph<A, I>

source

pub fn new(index: I) -> IndexedTxGraph<A, I>

Construct a new IndexedTxGraph with a given index.

\n
source

pub fn graph(&self) -> &TxGraph<A>

Get a reference of the internal transaction graph.

\n
",0,"example_cli::KeychainTxGraph"],["
source§

impl<A, I> IndexedTxGraph<A, I>
where\n A: Anchor,\n I: Indexer,

source

pub fn apply_changeset(\n &mut self,\n changeset: ChangeSet<A, <I as Indexer>::ChangeSet>\n)

Applies the ChangeSet to the IndexedTxGraph.

\n
source

pub fn initial_changeset(&self) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Determines the ChangeSet between self and an empty IndexedTxGraph.

\n
",0,"example_cli::KeychainTxGraph"],["
source§

impl<A, I> IndexedTxGraph<A, I>
where\n A: Anchor,\n I: Indexer,\n <I as Indexer>::ChangeSet: Default + Merge,

source

pub fn apply_update(\n &mut self,\n update: TxGraph<A>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Apply an update directly.

\n

update is a TxGraph<A> and the resultant changes is returned as ChangeSet.

\n
source

pub fn insert_txout(\n &mut self,\n outpoint: OutPoint,\n txout: TxOut\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert a floating txout of given outpoint.

\n
source

pub fn insert_tx(\n &mut self,\n tx: Transaction\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert and index a transaction into the graph.

\n
source

pub fn insert_anchor(\n &mut self,\n txid: Txid,\n anchor: A\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert an anchor for a given transaction.

\n
source

pub fn insert_seen_at(\n &mut self,\n txid: Txid,\n seen_at: u64\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Insert a unix timestamp of when a transaction is seen in the mempool.

\n

This is used for transaction conflict resolution in TxGraph where the transaction with\nthe later last-seen is prioritized.

\n
source

pub fn batch_insert_relevant<'t>(\n &mut self,\n txs: impl IntoIterator<Item = (&'t Transaction, impl IntoIterator<Item = A>)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert transactions, filtering out those that are irrelevant.

\n

Relevancy is determined by the Indexer::is_tx_relevant implementation of I. Irrelevant\ntransactions in txs will be ignored. txs do not need to be in topological order.

\n
source

pub fn batch_insert_relevant_unconfirmed<'t>(\n &mut self,\n unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert unconfirmed transactions, filtering out those that are irrelevant.

\n

Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I.\nIrrelevant transactions in txs will be ignored.

\n

Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

\n
source

pub fn batch_insert_unconfirmed(\n &mut self,\n txs: impl IntoIterator<Item = (Transaction, u64)>\n) -> ChangeSet<A, <I as Indexer>::ChangeSet>

Batch insert unconfirmed transactions.

\n

Items of txs are tuples containing the transaction and a last seen timestamp. The\nlast seen communicates when the transaction is last seen in the mempool which is used for\nconflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

\n

To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

\n
",0,"example_cli::KeychainTxGraph"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/persist/struct.Persisted.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/persist/struct.Persisted.js index bc361f3e5b..6003302606 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/persist/struct.Persisted.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/persist/struct.Persisted.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"bdk_wallet":[["
§

impl<T> Debug for Persisted<T>
where\n T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> Deref for Persisted<T>

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &<Persisted<T> as Deref>::Target

Dereferences the value.
","Deref","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> DerefMut for Persisted<T>

§

fn deref_mut(&mut self) -> &mut <Persisted<T> as Deref>::Target

Mutably dereferences the value.
","DerefMut","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> Ord for Persisted<T>
where\n T: Ord,

§

fn cmp(&self, other: &Persisted<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> PartialEq for Persisted<T>
where\n T: PartialEq,

§

fn eq(&self, other: &Persisted<T>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> PartialOrd for Persisted<T>
where\n T: PartialOrd,

§

fn partial_cmp(&self, other: &Persisted<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> Persisted<T>

pub fn create<Db>(\n db: &mut Db,\n params: <T as PersistWith<Db>>::CreateParams\n) -> Result<Persisted<T>, <T as PersistWith<Db>>::CreateError>
where\n T: PersistWith<Db>,

Create a new persisted T.

\n

pub async fn create_async<Db>(\n db: &mut Db,\n params: <T as PersistAsyncWith<Db>>::CreateParams\n) -> Result<Persisted<T>, <T as PersistAsyncWith<Db>>::CreateError>
where\n T: PersistAsyncWith<Db>,

Create a new persisted T with async Db.

\n

pub fn load<Db>(\n db: &mut Db,\n params: <T as PersistWith<Db>>::LoadParams\n) -> Result<Option<Persisted<T>>, <T as PersistWith<Db>>::LoadError>
where\n T: PersistWith<Db>,

Construct a persisted T from Db.

\n

pub async fn load_async<Db>(\n db: &mut Db,\n params: <T as PersistAsyncWith<Db>>::LoadParams\n) -> Result<Option<Persisted<T>>, <T as PersistAsyncWith<Db>>::LoadError>
where\n T: PersistAsyncWith<Db>,

Construct a persisted T from an async Db.

\n

pub fn persist<Db>(\n &mut self,\n db: &mut Db\n) -> Result<bool, <T as PersistWith<Db>>::PersistError>
where\n T: PersistWith<Db>,

Persist staged changes of T into Db.

\n

If the database errors, the staged changes will not be cleared.

\n

pub async fn persist_async<'a, Db>(\n &'a mut self,\n db: &'a mut Db\n) -> Result<bool, <T as PersistAsyncWith<Db>>::PersistError>
where\n T: PersistAsyncWith<Db>,

Persist staged changes of T into an async Db.

\n

If the database errors, the staged changes will not be cleared.

\n
",0,"bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> Eq for Persisted<T>
where\n T: Eq,

","Eq","bdk_wallet::wallet::persisted::PersistedWallet"],["
§

impl<T> StructuralPartialEq for Persisted<T>

","StructuralPartialEq","bdk_wallet::wallet::persisted::PersistedWallet"]] +"bdk_wallet":[["
source§

impl<T> Debug for Persisted<T>
where\n T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> Deref for Persisted<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Persisted<T> as Deref>::Target

Dereferences the value.
","Deref","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> DerefMut for Persisted<T>

source§

fn deref_mut(&mut self) -> &mut <Persisted<T> as Deref>::Target

Mutably dereferences the value.
","DerefMut","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> Ord for Persisted<T>
where\n T: Ord,

source§

fn cmp(&self, other: &Persisted<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> PartialEq for Persisted<T>
where\n T: PartialEq,

source§

fn eq(&self, other: &Persisted<T>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> PartialOrd for Persisted<T>
where\n T: PartialOrd,

source§

fn partial_cmp(&self, other: &Persisted<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> Persisted<T>

source

pub fn create<Db>(\n db: &mut Db,\n params: <T as PersistWith<Db>>::CreateParams\n) -> Result<Persisted<T>, <T as PersistWith<Db>>::CreateError>
where\n T: PersistWith<Db>,

Create a new persisted T.

\n
source

pub async fn create_async<Db>(\n db: &mut Db,\n params: <T as PersistAsyncWith<Db>>::CreateParams\n) -> Result<Persisted<T>, <T as PersistAsyncWith<Db>>::CreateError>
where\n T: PersistAsyncWith<Db>,

Create a new persisted T with async Db.

\n
source

pub fn load<Db>(\n db: &mut Db,\n params: <T as PersistWith<Db>>::LoadParams\n) -> Result<Option<Persisted<T>>, <T as PersistWith<Db>>::LoadError>
where\n T: PersistWith<Db>,

Construct a persisted T from Db.

\n
source

pub async fn load_async<Db>(\n db: &mut Db,\n params: <T as PersistAsyncWith<Db>>::LoadParams\n) -> Result<Option<Persisted<T>>, <T as PersistAsyncWith<Db>>::LoadError>
where\n T: PersistAsyncWith<Db>,

Construct a persisted T from an async Db.

\n
source

pub fn persist<Db>(\n &mut self,\n db: &mut Db\n) -> Result<bool, <T as PersistWith<Db>>::PersistError>
where\n T: PersistWith<Db>,

Persist staged changes of T into Db.

\n

If the database errors, the staged changes will not be cleared.

\n
source

pub async fn persist_async<'a, Db>(\n &'a mut self,\n db: &'a mut Db\n) -> Result<bool, <T as PersistAsyncWith<Db>>::PersistError>
where\n T: PersistAsyncWith<Db>,

Persist staged changes of T into an async Db.

\n

If the database errors, the staged changes will not be cleared.

\n
",0,"bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> Eq for Persisted<T>
where\n T: Eq,

","Eq","bdk_wallet::wallet::persisted::PersistedWallet"],["
source§

impl<T> StructuralPartialEq for Persisted<T>

","StructuralPartialEq","bdk_wallet::wallet::persisted::PersistedWallet"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js index b290095773..df4a3692a7 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"bdk_wallet":[["
§

impl<Pk> Clone for Descriptor<Pk>
where\n Pk: Clone + MiniscriptKey,

§

fn clone(&self) -> Descriptor<Pk>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Debug for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DefiniteDescriptorKey>

pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>\n) -> Result<Descriptor<PublicKey>, ConversionError>
where\n C: Verification,

Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

\n
§Examples
\n
use miniscript::descriptor::{Descriptor, DescriptorPublicKey};\nuse miniscript::bitcoin::secp256k1;\nuse std::str::FromStr;\n\n// test from bip 86\nlet secp = secp256k1::Secp256k1::verification_only();\nlet descriptor = Descriptor::<DescriptorPublicKey>::from_str(\"tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\")\n    .expect(\"Valid ranged descriptor\");\nlet result = descriptor.at_derivation_index(0).unwrap().derived_descriptor(&secp).expect(\"Non-hardened derivation\");\nassert_eq!(result.to_string(), \"tr(03cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115)#6qm9h8ym\");
\n
§Errors
\n

This function will return an error if hardened derivation is attempted.

\n
",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DefiniteDescriptorKey>

pub fn plan<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
where\n P: AssetProvider<DefiniteDescriptorKey>,

Returns a plan if the provided assets are sufficient to produce a non-malleable satisfaction

\n

If the assets aren’t sufficient for generating a Plan, the descriptor is returned

\n

pub fn plan_mall<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
where\n P: AssetProvider<DefiniteDescriptorKey>,

Returns a plan if the provided assets are sufficient to produce a malleable satisfaction

\n

If the assets aren’t sufficient for generating a Plan, the descriptor is returned

\n
",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DescriptorPublicKey>

pub fn is_deriveable(&self) -> bool

👎Deprecated: use has_wildcards instead

Whether or not the descriptor has any wildcards

\n

pub fn has_wildcard(&self) -> bool

Whether or not the descriptor has any wildcards i.e. /*.

\n

pub fn at_derivation_index(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

Replaces all wildcards (i.e. /*) in the descriptor with a particular derivation index,\nturning it into a definite descriptor.

\n
§Errors
\n
    \n
  • If index ≥ 2^31
  • \n
\n

pub fn derive(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

👎Deprecated: use at_derivation_index instead

Deprecated name for Self::at_derivation_index.

\n

pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>,\n index: u32\n) -> Result<Descriptor<PublicKey>, ConversionError>
where\n C: Verification,

Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

\n

This is a shorthand for:

\n\n
    .expect(\"Valid ranged descriptor\");\nlet derived_descriptor = descriptor.at_derivation_index(index).unwrap().derived_descriptor(&secp).unwrap();
\n

and is only here really here for backwards compatibility.\nSee at_derivation_index and [derived_descriptor] for more documentation.

\n
§Errors
\n

This function will return an error if hardened derivation is attempted.

\n

pub fn parse_descriptor<C>(\n secp: &Secp256k1<C>,\n s: &str\n) -> Result<(Descriptor<DescriptorPublicKey>, BTreeMap<DescriptorPublicKey, DescriptorSecretKey>), Error>
where\n C: Signing,

Parse a descriptor that may contain secret keys

\n

Internally turns every secret key found into the corresponding public key and then returns a\na descriptor that only contains public keys and a map to lookup the secret key given a public key.

\n

pub fn to_string_with_secret(\n &self,\n key_map: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>\n) -> String

Serialize a descriptor to string with its secret keys

\n

pub fn find_derivation_index_for_spk<C>(\n &self,\n secp: &Secp256k1<C>,\n script_pubkey: &Script,\n range: Range<u32>\n) -> Result<Option<(u32, Descriptor<PublicKey>)>, ConversionError>
where\n C: Verification,

Utility method for deriving the descriptor at each index in a range to find one matching\nscript_pubkey.

\n

If it finds a match then it returns the index it was derived at and the concrete\ndescriptor at that index. If the descriptor is non-derivable then it will simply check the\nscript pubkey against the descriptor and return it if it matches (in this case the index\nreturned will be meaningless).

\n

pub fn is_multipath(&self) -> bool

Whether this descriptor contains a key that has multiple derivation paths.

\n

pub fn into_single_descriptors(\n self\n) -> Result<Vec<Descriptor<DescriptorPublicKey>>, Error>

Get as many descriptors as different paths in this descriptor.

\n

For multipath descriptors it will return as many descriptors as there is\n“parallel” paths. For regular descriptors it will just return itself.

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<Pk> Descriptor<Pk>
where\n Pk: MiniscriptKey + ToPublicKey,

pub fn address(&self, network: Network) -> Result<Address, Error>

Computes the Bitcoin address of the descriptor, if one exists

\n

Some descriptors like pk() don’t have an address.

\n
§Errors
\n

For raw/bare descriptors that don’t have an address.

\n

pub fn script_pubkey(&self) -> ScriptBuf

Computes the scriptpubkey of the descriptor.

\n

pub fn unsigned_script_sig(&self) -> ScriptBuf

Computes the scriptSig that will be in place for an unsigned input\nspending an output with this descriptor. For pre-segwit descriptors,\nwhich use the scriptSig for signatures, this returns the empty script.

\n

This is used in Segwit transactions to produce an unsigned transaction\nwhose txid will not change during signing (since only the witness data\nwill change).

\n

pub fn explicit_script(&self) -> Result<ScriptBuf, Error>

Computes the the underlying script before any hashing is done. For\nBare, Pkh and Wpkh this is the scriptPubkey; for ShWpkh and Sh\nthis is the redeemScript; for the others it is the witness script.

\n
§Errors
\n

If the descriptor is a taproot descriptor.

\n

pub fn script_code(&self) -> Result<ScriptBuf, Error>

Computes the scriptCode of a transaction output.

\n

The scriptCode is the Script of the previous transaction output being\nserialized in the sighash when evaluating a CHECKSIG & co. OP code.

\n
§Errors
\n

If the descriptor is a taproot descriptor.

\n

pub fn get_satisfaction<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
where\n S: Satisfier<Pk>,

Returns satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

\n

pub fn get_satisfaction_mall<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
where\n S: Satisfier<Pk>,

Returns a possilbly mallable satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

\n

pub fn satisfy<S>(&self, txin: &mut TxIn, satisfier: S) -> Result<(), Error>
where\n S: Satisfier<Pk>,

Attempts to produce a non-malleable satisfying witness and scriptSig to spend an\noutput controlled by the given descriptor; add the data to a given\nTxIn output.

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Descriptor<Pk>
where\n Pk: MiniscriptKey,

pub fn new_pk(pk: Pk) -> Descriptor<Pk>

Create a new pk descriptor

\n

pub fn new_pkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new PkH descriptor

\n

pub fn new_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new Wpkh descriptor\nWill return Err if uncompressed key is used

\n

pub fn new_sh_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wpkh from Pk.\nErrors when uncompressed keys are supplied

\n

pub fn new_sh(ms: Miniscript<Pk, Legacy>) -> Result<Descriptor<Pk>, Error>

Create a new sh for a given redeem script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

\n

pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

Create a new wsh descriptor from witness script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

\n

pub fn new_sh_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wsh descriptor with witness script\nErrors when miniscript exceeds resource limits under wsh context\nor does not type check at the top level

\n

pub fn new_bare(ms: Miniscript<Pk, BareCtx>) -> Result<Descriptor<Pk>, Error>

Create a new bare descriptor from witness script\nErrors when miniscript exceeds resource limits under bare context\nor does not type check at the top level

\n

pub fn new_sh_with_wpkh(wpkh: Wpkh<Pk>) -> Descriptor<Pk>

Create a new sh wrapper for the given wpkh descriptor

\n

pub fn new_sh_with_wsh(wsh: Wsh<Pk>) -> Descriptor<Pk>

Create a new sh wrapper for the given wsh descriptor

\n

pub fn new_sh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new sh sortedmulti descriptor with threshold k\nand Vec of pks.\nErrors when miniscript exceeds resource limits under p2sh context

\n

pub fn new_sh_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wsh sortedmulti descriptor from threshold\nk and Vec of pks\nErrors when miniscript exceeds resource limits under segwit context

\n

pub fn new_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new wsh sorted multi descriptor\nErrors when miniscript exceeds resource limits under p2sh context

\n

pub fn new_tr(\n key: Pk,\n script: Option<TapTree<Pk>>\n) -> Result<Descriptor<Pk>, Error>

Create new tr descriptor\nErrors when miniscript exceeds resource limits under Tap context

\n

pub fn desc_type(&self) -> DescriptorType

Get the [DescriptorType] of Descriptor

\n

pub fn sanity_check(&self) -> Result<(), Error>

Checks whether the descriptor is safe.

\n

Checks whether all the spend paths in the descriptor are possible on the\nbitcoin network under the current standardness and consensus rules. Also\nchecks whether the descriptor requires signatures on all spend paths and\nwhether the script is malleable.

\n

In general, all the guarantees of miniscript hold only for safe scripts.\nThe signer may not be able to find satisfactions even if one exists.

\n

pub fn max_weight_to_satisfy(&self) -> Result<Weight, Error>

Computes an upper bound on the difference between a non-satisfied\nTxIn’s segwit_weight and a satisfied TxIn’s segwit_weight

\n

Since this method uses segwit_weight instead of legacy_weight,\nif you want to include only legacy inputs in your transaction,\nyou should remove 1WU from each input’s max_weight_to_satisfy\nfor a more accurate estimate.

\n

In other words, for segwit inputs or legacy inputs included in\nsegwit transactions, the following will hold for each input if\nthat input was satisfied with the largest possible witness:

\n\n
ⓘ
for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].segwit_weight() - TxIn::default().segwit_weight()\n    );\n}
\n

Instead, for legacy transactions, the following will hold for each input\nif that input was satisfied with the largest possible witness:

\n\n
ⓘ
for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].legacy_weight() - TxIn::default().legacy_weight()\n    );\n}
\n

Assumes all ECDSA signatures are 73 bytes, including push opcode and\nsighash suffix.\nAssumes all Schnorr signatures are 66 bytes, including push opcode and\nsighash suffix.

\n
§Errors
\n

When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

\n

pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

👎Deprecated since 10.0.0: Use max_weight_to_satisfy instead. The method to count bytes was redesigned and the results will differ from max_weight_to_satisfy. For more details check rust-bitcoin/rust-miniscript#476.

Computes an upper bound on the weight of a satisfying witness to the\ntransaction.

\n

Assumes all ec-signatures are 73 bytes, including push opcode and\nsighash suffix. Includes the weight of the VarInts encoding the\nscriptSig and witness stack length.

\n
§Errors
\n

When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl DescriptorExt for Descriptor<DescriptorPublicKey>

§

fn dust_value(&self) -> u64

Returns the minimum value (in satoshis) at which an output is broadcastable.\nPanics if the descriptor wildcard is hardened.
§

fn descriptor_id(&self) -> DescriptorId

Returns the descriptor ID, calculated as the sha256 hash of the spk derived from the\ndescriptor at index 0.
","DescriptorExt","bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
where\n Pk: FromStrKey,

§

fn deserialize<D>(\n deserializer: D\n) -> Result<Descriptor<Pk>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Display for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
source§

impl ExtractPolicy for Descriptor<DescriptorPublicKey>

source§

fn extract_policy(\n &self,\n signers: &SignersContainer,\n build_sat: BuildSatisfaction<'_>,\n secp: &Secp256k1<All>\n) -> Result<Option<Policy>, Error>

Extract the spending policy
","ExtractPolicy","bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<Pk> ForEachKey<Pk> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn for_each_key<'a, F>(&'a self, pred: F) -> bool
where\n F: FnMut(&'a Pk) -> bool,

Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for every key
§

fn for_any_key<'a, F>(&'a self, pred: F) -> bool
where\n F: FnMut(&'a Pk) -> bool,\n Pk: 'a,

Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for any key
","ForEachKey","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Bare<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Bare<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Pkh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Sh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Sh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Tr<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> FromStr for Descriptor<Pk>
where\n Pk: FromStrKey,

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

Parses a string s to return a value of this type. Read more
","FromStr","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> FromTree for Descriptor<Pk>
where\n Pk: FromStrKey,

§

fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

Parse an expression tree into a descriptor.

\n
","FromTree","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Hash for Descriptor<Pk>
where\n Pk: Hash + MiniscriptKey,

§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Liftable<Pk> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn lift(&self) -> Result<Policy<Pk>, Error>

Converts this object into an abstract policy.
","Liftable","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Ord for Descriptor<Pk>
where\n Pk: Ord + MiniscriptKey,

§

fn cmp(&self, other: &Descriptor<Pk>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> PartialEq for Descriptor<Pk>
where\n Pk: PartialEq + MiniscriptKey,

§

fn eq(&self, other: &Descriptor<Pk>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> PartialOrd for Descriptor<Pk>
where\n Pk: PartialOrd + MiniscriptKey,

§

fn partial_cmp(&self, other: &Descriptor<Pk>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<'de, Pk> Serialize for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<P, Q> TranslatePk<P, Q> for Descriptor<P>
where\n P: MiniscriptKey,\n Q: MiniscriptKey,

§

fn translate_pk<T, E>(\n &self,\n t: &mut T\n) -> Result<<Descriptor<P> as TranslatePk<P, Q>>::Output, TranslateErr<E>>
where\n T: Translator<P, Q, E>,

Converts a descriptor using abstract keys to one using specific keys.

\n
§

type Output = Descriptor<Q>

The associated output type. This must be Self<Q>.
","TranslatePk","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Eq for Descriptor<Pk>
where\n Pk: Eq + MiniscriptKey,

","Eq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> StructuralPartialEq for Descriptor<Pk>
where\n Pk: MiniscriptKey,

","StructuralPartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"]] +"bdk_wallet":[["
§

impl<Pk> Clone for Descriptor<Pk>
where\n Pk: Clone + MiniscriptKey,

§

fn clone(&self) -> Descriptor<Pk>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Debug for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DefiniteDescriptorKey>

pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>\n) -> Result<Descriptor<PublicKey>, ConversionError>
where\n C: Verification,

Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

\n
§Examples
\n
use miniscript::descriptor::{Descriptor, DescriptorPublicKey};\nuse miniscript::bitcoin::secp256k1;\nuse std::str::FromStr;\n\n// test from bip 86\nlet secp = secp256k1::Secp256k1::verification_only();\nlet descriptor = Descriptor::<DescriptorPublicKey>::from_str(\"tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\")\n    .expect(\"Valid ranged descriptor\");\nlet result = descriptor.at_derivation_index(0).unwrap().derived_descriptor(&secp).expect(\"Non-hardened derivation\");\nassert_eq!(result.to_string(), \"tr(03cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115)#6qm9h8ym\");
\n
§Errors
\n

This function will return an error if hardened derivation is attempted.

\n
",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DefiniteDescriptorKey>

pub fn plan<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
where\n P: AssetProvider<DefiniteDescriptorKey>,

Returns a plan if the provided assets are sufficient to produce a non-malleable satisfaction

\n

If the assets aren’t sufficient for generating a Plan, the descriptor is returned

\n

pub fn plan_mall<P>(\n self,\n provider: &P\n) -> Result<Plan, Descriptor<DefiniteDescriptorKey>>
where\n P: AssetProvider<DefiniteDescriptorKey>,

Returns a plan if the provided assets are sufficient to produce a malleable satisfaction

\n

If the assets aren’t sufficient for generating a Plan, the descriptor is returned

\n
",0,"bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl Descriptor<DescriptorPublicKey>

pub fn is_deriveable(&self) -> bool

👎Deprecated: use has_wildcards instead

Whether or not the descriptor has any wildcards

\n

pub fn has_wildcard(&self) -> bool

Whether or not the descriptor has any wildcards i.e. /*.

\n

pub fn at_derivation_index(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

Replaces all wildcards (i.e. /*) in the descriptor with a particular derivation index,\nturning it into a definite descriptor.

\n
§Errors
\n
    \n
  • If index ≥ 2^31
  • \n
\n

pub fn derive(\n &self,\n index: u32\n) -> Result<Descriptor<DefiniteDescriptorKey>, ConversionError>

👎Deprecated: use at_derivation_index instead

Deprecated name for Self::at_derivation_index.

\n

pub fn derived_descriptor<C>(\n &self,\n secp: &Secp256k1<C>,\n index: u32\n) -> Result<Descriptor<PublicKey>, ConversionError>
where\n C: Verification,

Convert all the public keys in the descriptor to [bitcoin::PublicKey] by deriving them or\notherwise converting them. All [bitcoin::secp256k1::XOnlyPublicKey]s are converted to by adding a\ndefault(0x02) y-coordinate.

\n

This is a shorthand for:

\n\n
    .expect(\"Valid ranged descriptor\");\nlet derived_descriptor = descriptor.at_derivation_index(index).unwrap().derived_descriptor(&secp).unwrap();
\n

and is only here really here for backwards compatibility.\nSee at_derivation_index and [derived_descriptor] for more documentation.

\n
§Errors
\n

This function will return an error if hardened derivation is attempted.

\n

pub fn parse_descriptor<C>(\n secp: &Secp256k1<C>,\n s: &str\n) -> Result<(Descriptor<DescriptorPublicKey>, BTreeMap<DescriptorPublicKey, DescriptorSecretKey>), Error>
where\n C: Signing,

Parse a descriptor that may contain secret keys

\n

Internally turns every secret key found into the corresponding public key and then returns a\na descriptor that only contains public keys and a map to lookup the secret key given a public key.

\n

pub fn to_string_with_secret(\n &self,\n key_map: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>\n) -> String

Serialize a descriptor to string with its secret keys

\n

pub fn find_derivation_index_for_spk<C>(\n &self,\n secp: &Secp256k1<C>,\n script_pubkey: &Script,\n range: Range<u32>\n) -> Result<Option<(u32, Descriptor<PublicKey>)>, ConversionError>
where\n C: Verification,

Utility method for deriving the descriptor at each index in a range to find one matching\nscript_pubkey.

\n

If it finds a match then it returns the index it was derived at and the concrete\ndescriptor at that index. If the descriptor is non-derivable then it will simply check the\nscript pubkey against the descriptor and return it if it matches (in this case the index\nreturned will be meaningless).

\n

pub fn is_multipath(&self) -> bool

Whether this descriptor contains a key that has multiple derivation paths.

\n

pub fn into_single_descriptors(\n self\n) -> Result<Vec<Descriptor<DescriptorPublicKey>>, Error>

Get as many descriptors as different paths in this descriptor.

\n

For multipath descriptors it will return as many descriptors as there is\n“parallel” paths. For regular descriptors it will just return itself.

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<Pk> Descriptor<Pk>
where\n Pk: MiniscriptKey + ToPublicKey,

pub fn address(&self, network: Network) -> Result<Address, Error>

Computes the Bitcoin address of the descriptor, if one exists

\n

Some descriptors like pk() don’t have an address.

\n
§Errors
\n

For raw/bare descriptors that don’t have an address.

\n

pub fn script_pubkey(&self) -> ScriptBuf

Computes the scriptpubkey of the descriptor.

\n

pub fn unsigned_script_sig(&self) -> ScriptBuf

Computes the scriptSig that will be in place for an unsigned input\nspending an output with this descriptor. For pre-segwit descriptors,\nwhich use the scriptSig for signatures, this returns the empty script.

\n

This is used in Segwit transactions to produce an unsigned transaction\nwhose txid will not change during signing (since only the witness data\nwill change).

\n

pub fn explicit_script(&self) -> Result<ScriptBuf, Error>

Computes the the underlying script before any hashing is done. For\nBare, Pkh and Wpkh this is the scriptPubkey; for ShWpkh and Sh\nthis is the redeemScript; for the others it is the witness script.

\n
§Errors
\n

If the descriptor is a taproot descriptor.

\n

pub fn script_code(&self) -> Result<ScriptBuf, Error>

Computes the scriptCode of a transaction output.

\n

The scriptCode is the Script of the previous transaction output being\nserialized in the sighash when evaluating a CHECKSIG & co. OP code.

\n
§Errors
\n

If the descriptor is a taproot descriptor.

\n

pub fn get_satisfaction<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
where\n S: Satisfier<Pk>,

Returns satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

\n

pub fn get_satisfaction_mall<S>(\n &self,\n satisfier: S\n) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error>
where\n S: Satisfier<Pk>,

Returns a possilbly mallable satisfying non-malleable witness and scriptSig to spend an\noutput controlled by the given descriptor if it possible to\nconstruct one using the satisfier S.

\n

pub fn satisfy<S>(&self, txin: &mut TxIn, satisfier: S) -> Result<(), Error>
where\n S: Satisfier<Pk>,

Attempts to produce a non-malleable satisfying witness and scriptSig to spend an\noutput controlled by the given descriptor; add the data to a given\nTxIn output.

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Descriptor<Pk>
where\n Pk: MiniscriptKey,

pub fn new_pk(pk: Pk) -> Descriptor<Pk>

Create a new pk descriptor

\n

pub fn new_pkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new PkH descriptor

\n

pub fn new_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new Wpkh descriptor\nWill return Err if uncompressed key is used

\n

pub fn new_sh_wpkh(pk: Pk) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wpkh from Pk.\nErrors when uncompressed keys are supplied

\n

pub fn new_sh(ms: Miniscript<Pk, Legacy>) -> Result<Descriptor<Pk>, Error>

Create a new sh for a given redeem script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

\n

pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

Create a new wsh descriptor from witness script\nErrors when miniscript exceeds resource limits under p2sh context\nor does not type check at the top level

\n

pub fn new_sh_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wsh descriptor with witness script\nErrors when miniscript exceeds resource limits under wsh context\nor does not type check at the top level

\n

pub fn new_bare(ms: Miniscript<Pk, BareCtx>) -> Result<Descriptor<Pk>, Error>

Create a new bare descriptor from witness script\nErrors when miniscript exceeds resource limits under bare context\nor does not type check at the top level

\n

pub fn new_sh_with_wpkh(wpkh: Wpkh<Pk>) -> Descriptor<Pk>

Create a new sh wrapper for the given wpkh descriptor

\n

pub fn new_sh_with_wsh(wsh: Wsh<Pk>) -> Descriptor<Pk>

Create a new sh wrapper for the given wsh descriptor

\n

pub fn new_sh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new sh sortedmulti descriptor with threshold k\nand Vec of pks.\nErrors when miniscript exceeds resource limits under p2sh context

\n

pub fn new_sh_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new sh wrapped wsh sortedmulti descriptor from threshold\nk and Vec of pks\nErrors when miniscript exceeds resource limits under segwit context

\n

pub fn new_wsh_sortedmulti(\n k: usize,\n pks: Vec<Pk>\n) -> Result<Descriptor<Pk>, Error>

Create a new wsh sorted multi descriptor\nErrors when miniscript exceeds resource limits under p2sh context

\n

pub fn new_tr(\n key: Pk,\n script: Option<TapTree<Pk>>\n) -> Result<Descriptor<Pk>, Error>

Create new tr descriptor\nErrors when miniscript exceeds resource limits under Tap context

\n

pub fn desc_type(&self) -> DescriptorType

Get the [DescriptorType] of Descriptor

\n

pub fn sanity_check(&self) -> Result<(), Error>

Checks whether the descriptor is safe.

\n

Checks whether all the spend paths in the descriptor are possible on the\nbitcoin network under the current standardness and consensus rules. Also\nchecks whether the descriptor requires signatures on all spend paths and\nwhether the script is malleable.

\n

In general, all the guarantees of miniscript hold only for safe scripts.\nThe signer may not be able to find satisfactions even if one exists.

\n

pub fn max_weight_to_satisfy(&self) -> Result<Weight, Error>

Computes an upper bound on the difference between a non-satisfied\nTxIn’s segwit_weight and a satisfied TxIn’s segwit_weight

\n

Since this method uses segwit_weight instead of legacy_weight,\nif you want to include only legacy inputs in your transaction,\nyou should remove 1WU from each input’s max_weight_to_satisfy\nfor a more accurate estimate.

\n

In other words, for segwit inputs or legacy inputs included in\nsegwit transactions, the following will hold for each input if\nthat input was satisfied with the largest possible witness:

\n\n
ⓘ
for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].segwit_weight() - TxIn::default().segwit_weight()\n    );\n}
\n

Instead, for legacy transactions, the following will hold for each input\nif that input was satisfied with the largest possible witness:

\n\n
ⓘ
for i in 0..transaction.input.len() {\n    assert_eq!(\n        descriptor_for_input[i].max_weight_to_satisfy(),\n        transaction.input[i].legacy_weight() - TxIn::default().legacy_weight()\n    );\n}
\n

Assumes all ECDSA signatures are 73 bytes, including push opcode and\nsighash suffix.\nAssumes all Schnorr signatures are 66 bytes, including push opcode and\nsighash suffix.

\n
§Errors
\n

When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

\n

pub fn max_satisfaction_weight(&self) -> Result<usize, Error>

👎Deprecated since 10.0.0: Use max_weight_to_satisfy instead. The method to count bytes was redesigned and the results will differ from max_weight_to_satisfy. For more details check rust-bitcoin/rust-miniscript#476.

Computes an upper bound on the weight of a satisfying witness to the\ntransaction.

\n

Assumes all ec-signatures are 73 bytes, including push opcode and\nsighash suffix. Includes the weight of the VarInts encoding the\nscriptSig and witness stack length.

\n
§Errors
\n

When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).

\n
",0,"bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
source§

impl DescriptorExt for Descriptor<DescriptorPublicKey>

source§

fn dust_value(&self) -> u64

Returns the minimum value (in satoshis) at which an output is broadcastable.\nPanics if the descriptor wildcard is hardened.
source§

fn descriptor_id(&self) -> DescriptorId

Returns the descriptor ID, calculated as the sha256 hash of the spk derived from the\ndescriptor at index 0.
","DescriptorExt","bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<'de, Pk> Deserialize<'de> for Descriptor<Pk>
where\n Pk: FromStrKey,

§

fn deserialize<D>(\n deserializer: D\n) -> Result<Descriptor<Pk>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Display for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
source§

impl ExtractPolicy for Descriptor<DescriptorPublicKey>

source§

fn extract_policy(\n &self,\n signers: &SignersContainer,\n build_sat: BuildSatisfaction<'_>,\n secp: &Secp256k1<All>\n) -> Result<Option<Policy>, Error>

Extract the spending policy
","ExtractPolicy","bdk_wallet::descriptor::ExtendedDescriptor"],["
§

impl<Pk> ForEachKey<Pk> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn for_each_key<'a, F>(&'a self, pred: F) -> bool
where\n F: FnMut(&'a Pk) -> bool,

Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for every key
§

fn for_any_key<'a, F>(&'a self, pred: F) -> bool
where\n F: FnMut(&'a Pk) -> bool,\n Pk: 'a,

Run a predicate on every key in the descriptor, returning whether\nthe predicate returned true for any key
","ForEachKey","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Bare<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Bare<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Pkh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Pkh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Sh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Sh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Tr<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Tr<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Wpkh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Wpkh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> From<Wsh<Pk>> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn from(inner: Wsh<Pk>) -> Descriptor<Pk>

Converts to this type from the input type.
","From>","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> FromStr for Descriptor<Pk>
where\n Pk: FromStrKey,

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Descriptor<Pk>, Error>

Parses a string s to return a value of this type. Read more
","FromStr","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> FromTree for Descriptor<Pk>
where\n Pk: FromStrKey,

§

fn from_tree(top: &Tree<'_>) -> Result<Descriptor<Pk>, Error>

Parse an expression tree into a descriptor.

\n
","FromTree","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Hash for Descriptor<Pk>
where\n Pk: Hash + MiniscriptKey,

§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Liftable<Pk> for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn lift(&self) -> Result<Policy<Pk>, Error>

Converts this object into an abstract policy.
","Liftable","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Ord for Descriptor<Pk>
where\n Pk: Ord + MiniscriptKey,

§

fn cmp(&self, other: &Descriptor<Pk>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> PartialEq for Descriptor<Pk>
where\n Pk: PartialEq + MiniscriptKey,

§

fn eq(&self, other: &Descriptor<Pk>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> PartialOrd for Descriptor<Pk>
where\n Pk: PartialOrd + MiniscriptKey,

§

fn partial_cmp(&self, other: &Descriptor<Pk>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<'de, Pk> Serialize for Descriptor<Pk>
where\n Pk: MiniscriptKey,

§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<P, Q> TranslatePk<P, Q> for Descriptor<P>
where\n P: MiniscriptKey,\n Q: MiniscriptKey,

§

fn translate_pk<T, E>(\n &self,\n t: &mut T\n) -> Result<<Descriptor<P> as TranslatePk<P, Q>>::Output, TranslateErr<E>>
where\n T: Translator<P, Q, E>,

Converts a descriptor using abstract keys to one using specific keys.

\n
§

type Output = Descriptor<Q>

The associated output type. This must be Self<Q>.
","TranslatePk","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> Eq for Descriptor<Pk>
where\n Pk: Eq + MiniscriptKey,

","Eq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"],["
§

impl<Pk> StructuralPartialEq for Descriptor<Pk>
where\n Pk: MiniscriptKey,

","StructuralPartialEq","bdk_wallet::descriptor::ExtendedDescriptor","bdk_wallet::descriptor::DerivedDescriptor"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file