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 CHECKLOCKTIMEVERIFY

Older(u32)

n CHECKSEQUENCEVERIFY

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

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

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

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.