Enum miniscript::miniscript::decode::Terminal[][src]

pub enum Terminal<Pk: MiniscriptKey, Ctx: ScriptContext> {
Show 26 variants True, False, PkK(Pk), PkH(Pk::Hash), After(u32), Older(u32), Sha256(Hash), Hash256(Hash), Ripemd160(Hash), Hash160(Hash), Alt(Arc<Miniscript<Pk, Ctx>>), Swap(Arc<Miniscript<Pk, Ctx>>), Check(Arc<Miniscript<Pk, Ctx>>), DupIf(Arc<Miniscript<Pk, Ctx>>), Verify(Arc<Miniscript<Pk, Ctx>>), NonZero(Arc<Miniscript<Pk, Ctx>>), ZeroNotEqual(Arc<Miniscript<Pk, Ctx>>), AndV(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), AndB(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), AndOr(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), OrB(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), OrD(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), OrC(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), OrI(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>), Thresh(usize, Vec<Arc<Miniscript<Pk, Ctx>>>), Multi(usize, Vec<Pk>),
}
Expand description

All AST elements

Variants

True

1

False

0

PkK

<key>

Tuple Fields of PkK

0: Pk
PkH

DUP HASH160 <keyhash> EQUALVERIFY

Tuple Fields of PkH

0: Pk::Hash
After

n CHECKLOCKTIMEVERIFY

Tuple Fields of After

0: u32
Older

n CHECKSEQUENCEVERIFY

Tuple Fields of Older

0: u32
Sha256

SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL

Tuple Fields of Sha256

0: Hash
Hash256

SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL

Tuple Fields of Hash256

0: Hash
Ripemd160

SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL

Tuple Fields of Ripemd160

0: Hash
Hash160

SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL

Tuple Fields of Hash160

0: Hash
Alt

TOALTSTACK [E] FROMALTSTACK

Tuple Fields of Alt

0: Arc<Miniscript<Pk, Ctx>>
Swap

SWAP [E1]

Tuple Fields of Swap

0: Arc<Miniscript<Pk, Ctx>>
Check

[Kt]/[Ke] CHECKSIG

Tuple Fields of Check

0: Arc<Miniscript<Pk, Ctx>>
DupIf

DUP IF [V] ENDIF

Tuple Fields of DupIf

0: Arc<Miniscript<Pk, Ctx>>
Verify

[T] VERIFY

Tuple Fields of Verify

0: Arc<Miniscript<Pk, Ctx>>
NonZero

SIZE 0NOTEQUAL IF Fn ENDIF

Tuple Fields of NonZero

0: Arc<Miniscript<Pk, Ctx>>
ZeroNotEqual

[X] 0NOTEQUAL

Tuple Fields of ZeroNotEqual

0: Arc<Miniscript<Pk, Ctx>>
AndV

[V] [T]/[V]/[F]/[Kt]

Tuple Fields of AndV

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
AndB

[E] [W] BOOLAND

Tuple Fields of AndB

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
AndOr

[various] NOTIF [various] ELSE [various] ENDIF

Tuple Fields of AndOr

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>2: Arc<Miniscript<Pk, Ctx>>
OrB

[E] [W] BOOLOR

Tuple Fields of OrB

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
OrD

[E] IFDUP NOTIF [T]/[E] ENDIF

Tuple Fields of OrD

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
OrC

[E] NOTIF [V] ENDIF

Tuple Fields of OrC

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
OrI

IF [various] ELSE [various] ENDIF

Tuple Fields of OrI

0: Arc<Miniscript<Pk, Ctx>>1: Arc<Miniscript<Pk, Ctx>>
Thresh

[E] ([W] ADD)* k EQUAL

Tuple Fields of Thresh

0: usize1: Vec<Arc<Miniscript<Pk, Ctx>>>
Multi

k ()* n CHECKMULTISIG

Tuple Fields of Multi

0: usize1: Vec<Pk>

Implementations

Encode the element as a fragment of Bitcoin Script. The inverse function, from Script to an AST element, is implemented in the parse module.

Size, in bytes of the script-pubkey. If this Miniscript is used outside of segwit (e.g. in a bare or P2SH descriptor), this quantity should be multiplied by 4 to compute the weight.

In general, it is not recommended to use this function directly, but to instead call the corresponding function on a Descriptor, which will handle the segwit/non-segwit technicalities for you.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Run a predicate on every key in the descriptor, returning whether the predicate returned true for every key Read more

Run a predicate on every key in the descriptor, returning whether the predicate returned true for any key Read more

Extract a structure from Tree representation

Feeds this value into the given Hasher. Read more

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

Convert the object into an abstract policy

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Convert an AST element with one public key type to one of another public key type .This will panic while converting to Segwit Miniscript using uncompressed public keys

The associated output type. This must be Self

Calls translate_pk with conversion functions that cannot fail

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

recently added

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

Converts the given value to a String. Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.