Skip to main content

Tag

Enum Tag 

Source
pub enum Tag {
Show 36 variants Wpkh, Tr, Wsh, Sh, Pkh, TapTree, Multi, SortedMulti, MultiA, SortedMultiA, PkK, PkH, Check, Verify, Swap, Alt, DupIf, NonZero, ZeroNotEqual, AndV, AndB, AndOr, OrB, OrC, OrD, OrI, Thresh, After, Older, Sha256, Hash160, Hash256, Ripemd160, RawPkH, False, True,
}
Expand description

Operator tag identifying a descriptor/Miniscript fragment kind.

Variants§

§

Wpkh

wpkh — P2WPKH descriptor.

§

Tr

tr — Taproot descriptor.

§

Wsh

wsh — P2WSH descriptor.

§

Sh

sh — P2SH descriptor.

§

Pkh

pkh — P2PKH descriptor.

§

TapTree

Taproot tree node.

§

Multi

multi — k-of-n multisig.

§

SortedMulti

sortedmulti — sorted-key multisig.

§

MultiA

multi_a — Tapscript multisig with OP_CHECKSIGADD.

§

SortedMultiA

sortedmulti_a — sorted-key Tapscript multisig.

§

PkK

Miniscript pk_k — bare public key check.

§

PkH

Miniscript pk_h — public-key-hash check.

§

Check

Miniscript c: wrapper (CHECKSIG).

§

Verify

Miniscript v: wrapper (VERIFY).

§

Swap

Miniscript s: wrapper (SWAP).

§

Alt

Miniscript a: wrapper (TOALTSTACK).

§

DupIf

Miniscript d: wrapper (DUPIF).

§

NonZero

Miniscript j: wrapper (NONZERO).

§

ZeroNotEqual

Miniscript n: wrapper (ZERONOTEQUAL).

§

AndV

Miniscript and_v.

§

AndB

Miniscript and_b.

§

AndOr

Miniscript andor.

§

OrB

Miniscript or_b.

§

OrC

Miniscript or_c.

§

OrD

Miniscript or_d.

§

OrI

Miniscript or_i.

§

Thresh

Miniscript thresh.

§

After

Miniscript after — absolute timelock.

§

Older

Miniscript older — relative timelock.

§

Sha256

Miniscript sha256.

§

Hash160

Miniscript hash160.

§

Hash256

Miniscript hash256 (primary 0x1F in v0.30; promoted from v0.x extension).

§

Ripemd160

Miniscript ripemd160 (primary 0x20 in v0.30; promoted from v0.x extension).

§

RawPkH

Raw public-key hash variant (primary 0x21 in v0.30; promoted from v0.x extension).

§

False

Miniscript 0 literal (primary 0x22 in v0.30; promoted from v0.x extension).

§

True

Miniscript 1 literal (primary 0x23 in v0.30; promoted from v0.x extension).

Implementations§

Source§

impl Tag

Source

pub fn write(&self, w: &mut BitWriter)

Encode this tag (6 bits primary, plus 4 more if extension) into w.

Source

pub fn read(r: &mut BitReader<'_>) -> Result<Self, Error>

Decode a tag from r, consuming 6 bits (or 10 for extension).

Per SPEC v0.30 §3.2 + §11.1: 6-bit primary values 0x24..=0x3E are the reserved range and produce Error::TagOutOfRange { primary }. Primary value 0x3F is the extension prefix; the decoder consumes the following 4-bit subcode and returns Error::TagOutOfRange { primary: 0x3F } because no extension variants are allocated in v0.30 (the subcode is consumed but not reported in the error payload).

Trait Implementations§

Source§

impl Clone for Tag

Source§

fn clone(&self) -> Tag

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Tag

Source§

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

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

impl Hash for Tag

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 PartialEq for Tag

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Tag

Source§

impl Eq for Tag

Source§

impl StructuralPartialEq for Tag

Auto Trait Implementations§

§

impl Freeze for Tag

§

impl RefUnwindSafe for Tag

§

impl Send for Tag

§

impl Sync for Tag

§

impl Unpin for Tag

§

impl UnsafeUnpin for Tag

§

impl UnwindSafe for Tag

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.