pub enum Terminal<Pk: MiniscriptKey, Ctx: ScriptContext> {
Show 28 variants True, False, PkK(Pk), PkH(Pk), RawPkH(Hash), After(PackedLockTime), Older(Sequence), Sha256(Pk::Sha256), Hash256(Pk::Hash256), Ripemd160(Pk::Ripemd160), Hash160(Pk::Hash160), 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>), MultiA(usizeVec<Pk>),
}
Expand description

All AST elements This variant is the inner Miniscript variant that allows the user to bypass some of the miniscript rules. You should never construct Terminal directly. This is only exposed to external user to allow matching on the crate::Miniscript

The average user should always use the crate::Descriptor APIs. Advanced users who want deal with Miniscript ASTs should use the crate::Miniscript APIs.

Variants

True

1

False

0

PkK(Pk)

<key>

PkH(Pk)

DUP HASH160 <keyhash> EQUALVERIFY

RawPkH(Hash)

Only for parsing PkH for Script. These raw descriptors are not yet specified in miniscript. We only this variant internally for inferring miniscripts from raw Scripts. It is not possible to construct this variant from any of the Miniscript APIs. We don’t have a generic over here because we don’t want to user to have any abstract reasoning over raw descriptors.

After(PackedLockTime)

n CHECKLOCKTIMEVERIFY

Older(Sequence)

n CHECKSEQUENCEVERIFY

Sha256(Pk::Sha256)

SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL

Hash256(Pk::Hash256)

SIZE 32 EQUALVERIFY HASH256 <hash> EQUAL

Ripemd160(Pk::Ripemd160)

SIZE 32 EQUALVERIFY RIPEMD160 <hash> EQUAL

Hash160(Pk::Hash160)

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

MultiA(usizeVec<Pk>)

CHECKSIG ( CHECKSIGADD)*(n-1) k NUMEQUAL

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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

Converts an AST element with one public key type to one of another public key type.

The associated output type. This must be Self<Q>.

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
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.