#[repr(u8)]
pub enum ConvertInfo {
    Bare,
    Hashed,
    NestedV0,
    SegWitV0,
    Taproot,
}
Expand description

Descriptor category specifies way how the scriptPubkey is structured

Variants§

§

Bare

Bare descriptors: pk and bare bitcoin_scripts, including OP_RETURNs.

The script or public key gets right into scriptPubkey, i.e. as P2PK (for a public key) or as custom script (mostly used for OP_RETURN)

§

Hashed

Hash-based descriptors: pkh for public key hashes and BIP-16 sh for P2SH bitcoin_scripts.

We hash public key or script and use non-SegWit scriptPubkey encoding, i.e. P2PKH or P2SH with corresponding non-segwit transaction input scriptSig containing copy of crate::LockScript in redeemScript field

§

NestedV0

SegWit descriptors for legacy wallets defined in BIP 141 as P2SH nested types https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH_nested_in_BIP16_P2SH: sh(wpkh) and sh(wsh)

Compatibility variant for SegWit outputs when the SegWit version and program are encoded as crate::RedeemScript in scriptSig transaction input field, while the original public key or crate::WitnessScript are stored in witness. scriptPubkey contains a normal P2SH composed agains the redeemScript from scriptSig (P2SH-P2WPKH and P2SH-P2WSH variants).

This type works with only with witness version v0, i.e. not applicable for Taproot.

§

SegWitV0

Native SegWit descriptors: wpkh for public keys and wsh for bitcoin_scripts

We produce either P2WPKH or P2WSH output and use witness field in transaction input to store the original crate::LockScript or the public key

§

Taproot

Native Taproot descriptors: taproot

Implementations§

source§

impl ConvertInfo

source

pub fn is_segwit(self) -> bool

Detects whether conversion is a non-nested segwit

source

pub fn is_taproot(self) -> bool

Detects whether conversion is a taproot conversion

Trait Implementations§

source§

impl Clone for ConvertInfo

source§

fn clone(&self) -> ConvertInfo

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 ConvertInfo

source§

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

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

impl Display for ConvertInfo

source§

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

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

impl Hash for ConvertInfo

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, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for ConvertInfo

source§

fn cmp(&self, other: &ConvertInfo) -> Ordering

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

fn max(self, other: Self) -> Selfwhere Self: Sized,

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

fn min(self, other: Self) -> Selfwhere Self: Sized,

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ConvertInfo> for ConvertInfo

source§

fn eq(&self, other: &ConvertInfo) -> 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 PartialOrd<ConvertInfo> for ConvertInfo

source§

fn partial_cmp(&self, other: &ConvertInfo) -> 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 <= operator. 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 >= operator. Read more
source§

impl Copy for ConvertInfo

source§

impl Eq for ConvertInfo

source§

impl StructuralEq for ConvertInfo

source§

impl StructuralPartialEq for ConvertInfo

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.