pub enum DescriptorScript {
Key(DescriptorKey),
Pkh(DescriptorKey),
Wpkh(DescriptorKey),
Sh(Box<DescriptorScript>),
Wsh(Box<DescriptorScript>),
Combo(DescriptorKey),
Multi {
threshold: usize,
keys: Vec<DescriptorKey>,
},
SortedMulti {
threshold: usize,
keys: Vec<DescriptorKey>,
},
Addr(String),
Raw(String),
Tr {
internal_key: DescriptorKey,
tree: Option<Box<DescriptorTree>>,
},
}Expand description
The parsed inner expression of an output descriptor.
This enum models all descriptor types defined in BIPs 380-386.
Variants§
Key(DescriptorKey)
pk(KEY) — bare pubkey output (BIP 380).
Pkh(DescriptorKey)
pkh(KEY) — P2PKH (BIP 382).
Wpkh(DescriptorKey)
wpkh(KEY) — P2WPKH (BIP 381/382).
Sh(Box<DescriptorScript>)
sh(SCRIPT) — P2SH wrapper (BIP 383).
Wsh(Box<DescriptorScript>)
wsh(SCRIPT) — P2WSH wrapper (BIP 381).
Combo(DescriptorKey)
combo(KEY) — pk + pkh + if-segwit wpkh + p2sh-wpkh (BIP 384).
Multi
multi(K, KEY…) — bare multisig (BIP 383).
SortedMulti
sortedmulti(K, KEY…) — multisig with sorted keys (BIP 383).
Fields
§
keys: Vec<DescriptorKey>The N keys (sorted at script generation time).
Addr(String)
addr(ADDRESS) — raw address descriptor (BIP 385).
Raw(String)
raw(HEX) — raw script hex (BIP 385).
Tr
tr(KEY) or tr(KEY, TREE) — Taproot (BIP 386).
Fields
§
internal_key: DescriptorKeyTaproot internal key.
§
tree: Option<Box<DescriptorTree>>Optional script-path tree.
Implementations§
Source§impl DescriptorScript
impl DescriptorScript
Sourcepub fn keys(&self) -> Vec<&DescriptorKey>
pub fn keys(&self) -> Vec<&DescriptorKey>
Collect all DescriptorKey references in this script recursively.
Trait Implementations§
Source§impl Clone for DescriptorScript
impl Clone for DescriptorScript
Source§fn clone(&self) -> DescriptorScript
fn clone(&self) -> DescriptorScript
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DescriptorScript
impl RefUnwindSafe for DescriptorScript
impl Send for DescriptorScript
impl Sync for DescriptorScript
impl Unpin for DescriptorScript
impl UnsafeUnpin for DescriptorScript
impl UnwindSafe for DescriptorScript
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more