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(usizeVec<Arc<Miniscript<Pk, Ctx>>>), Multi(usizeVec<Pk>),
}
Expand description

All AST elements

Variants

True

1

False

0

PkK(Pk)

<key>

PkH(Pk::Hash)

DUP HASH160 <keyhash> EQUALVERIFY

After(u32)

n CHECKSEQUENCEVERIFY

Older(u32)

n CHECKLOCKTIMEVERIFY

Sha256(Hash)

SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL

Hash256(Hash)

SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL

Ripemd160(Hash)

SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL

Hash160(Hash)

SIZE 32 EQUALVERIFY HASH160 <hash> EQUAL

Alt(Arc<Miniscript<Pk, Ctx>>)

TOALTSTACK [E] FROMALTSTACK

Swap(Arc<Miniscript<Pk, Ctx>>)

SWAP [E1]

Check(Arc<Miniscript<Pk, Ctx>>)

[Kt]/[Ke] CHECKSIG

DupIf(Arc<Miniscript<Pk, Ctx>>)

DUP IF [V] ENDIF

Verify(Arc<Miniscript<Pk, Ctx>>)

[T] VERIFY

NonZero(Arc<Miniscript<Pk, Ctx>>)

SIZE 0NOTEQUAL IF Fn ENDIF

ZeroNotEqual(Arc<Miniscript<Pk, Ctx>>)

[X] 0NOTEQUAL

AndV(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

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

AndB(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

[E] [W] BOOLAND

AndOr(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

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

OrB(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

[E] [W] BOOLOR

OrD(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

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

OrC(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

[E] NOTIF [V] ENDIF

OrI(Arc<Miniscript<Pk, Ctx>>, Arc<Miniscript<Pk, Ctx>>)

IF [various] ELSE [various] ENDIF

Thresh(usizeVec<Arc<Miniscript<Pk, Ctx>>>)

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

Multi(usizeVec<Pk>)

k ()* n CHECKMULTISIG

Implementations

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

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.

Maximum number of witness elements used to dissatisfy the Miniscript fragment. Used to estimate the weight of the VarInt that specifies this number in a serialized transaction.

Will panic if the fragment is not an E, W or Ke.

Maximum dissatisfaction cost, in bytes, of a Miniscript fragment, if it is possible to compute this. This function should probably not ever be used directly. It is called from max_satisfaction_size.

Will panic if the fragment is not E, W or Ke

Maximum number of witness elements used to satisfy the Miniscript fragment. Used to estimate the weight of the VarInt that specifies this number in a serialized transaction.

This number does not include the witness script itself, so 1 needs to be added to the final result.

Maximum size, in bytes, of a satisfying witness. For Segwit outputs one_cost should be set to 2, since the number 1 requires two bytes to encode. For non-segwit outputs one_cost should be set to 1, since OP_1 is available in scriptSigs.

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.

All signatures are assumed to be 73 bytes in size, including the length prefix (segwit) or push opcode (pre-segwit) and sighash postfix.

This function may panic on misformed Miniscript objects which do not correspond to semantically sane Scripts. (Such scripts should be rejected at parse time. Any exceptions are bugs.)

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

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

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

Returns the argument unchanged.

Calls U::from(self).

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

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)

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

Converts the given value to a String. 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.