pub struct ExtData {
    pub pk_cost: usize,
    pub has_free_verify: bool,
    pub ops_count_static: usize,
    pub ops_count_sat: Option<usize>,
    pub ops_count_nsat: Option<usize>,
    pub stack_elem_count_sat: Option<usize>,
    pub stack_elem_count_dissat: Option<usize>,
    pub max_sat_size: Option<(usize, usize)>,
    pub max_dissat_size: Option<(usize, usize)>,
    pub timelock_info: TimeLockInfo,
    pub exec_stack_elem_count_sat: Option<usize>,
    pub exec_stack_elem_count_dissat: Option<usize>,
}
Expand description

Structure representing the extra type properties of a fragment.

Fields§

§pk_cost: usize

The number of bytes needed to encode its scriptpubkey

§has_free_verify: bool

Whether this fragment can be verify-wrapped for free

§ops_count_static: usize

The worst case static(unexecuted) ops-count for this Miniscript fragment.

§ops_count_sat: Option<usize>

The worst case ops-count for satisfying this Miniscript fragment.

§ops_count_nsat: Option<usize>

The worst case ops-count for dissatisfying this Miniscript fragment.

§stack_elem_count_sat: Option<usize>

The worst case number of stack elements for satisfying this Miniscript fragment.

§stack_elem_count_dissat: Option<usize>

The worst case number of stack elements for dissatisfying this Miniscript fragment.

§max_sat_size: Option<(usize, usize)>

Maximum size, in bytes, of a satisfying witness. First elements is the cost for the witness stack, the second one is the cost for scriptSig. All signatures are assumed to be 73 bytes in size, including the length prefix (segwit) or push opcode (pre-segwit) and sighash postfix.

§max_dissat_size: Option<(usize, usize)>

Maximum dissatisfaction cost, in bytes, of a Miniscript fragment. First elements is the cost for the witness stack, the second one is the cost for scriptSig.

§timelock_info: TimeLockInfo

The timelock info about heightlocks and timelocks

§exec_stack_elem_count_sat: Option<usize>

Maximum stack + alt stack size during satisfaction execution This does not include initial witness elements. This element only captures the additional elements that are pushed during execution.

§exec_stack_elem_count_dissat: Option<usize>

Maximum stack + alt stack size during dissat execution This does not include initial witness elements. This element only captures the additional elements that are pushed during execution.

Trait Implementations§

source§

impl Clone for ExtData

source§

fn clone(&self) -> ExtData

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ExtData

source§

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

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

impl Hash for ExtData

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 Ord for ExtData

source§

fn cmp(&self, other: &ExtData) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ExtData

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ExtData

source§

fn partial_cmp(&self, other: &ExtData) -> Option<Ordering>

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

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

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

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

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

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

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

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

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

impl Property for ExtData

source§

fn type_check<Pk, Ctx, C>( fragment: &Terminal<Pk, Ctx>, _child: C ) -> Result<Self, Error<Pk, Ctx>>
where C: FnMut(usize) -> Option<Self>, Ctx: ScriptContext, Pk: MiniscriptKey,

Compute the type of a fragment assuming all the children of Miniscript have been computed already.

source§

fn sanity_checks(&self)

Any extra sanity checks/assertions that should be applied after typechecking
source§

fn from_true() -> Self

Type property of the True fragment
source§

fn from_false() -> Self

Type property of the False fragment
source§

fn from_pk_k() -> Self

Type property of the PkK fragment
source§

fn from_pk_h() -> Self

Type property of the PkH fragment
source§

fn from_multi(k: usize, n: usize) -> Self

Type property of a Multi fragment
source§

fn from_multi_a(k: usize, n: usize) -> Self

Type property of a MultiA fragment
source§

fn from_hash() -> Self

Type property of a hash fragment
source§

fn from_sha256() -> Self

Type property of a Sha256 hash. Default implementation simply passes through to from_hash
source§

fn from_txtemplate() -> Self

Type property of a TxTemplate hash. Default implementation simply passes through to from_txtemplate
source§

fn from_hash256() -> Self

Type property of a Hash256 hash. Default implementation simply passes through to from_hash
source§

fn from_ripemd160() -> Self

Type property of a Ripemd160 hash. Default implementation simply passes through to from_hash
source§

fn from_hash160() -> Self

Type property of a Hash160 hash. Default implementation simply passes through to from_hash
source§

fn from_time(_t: u32) -> Self

Type property of a timelock
source§

fn from_after(t: u32) -> Self

Type property of a relative timelock. Default implementation simply passes through to from_time
source§

fn from_older(t: u32) -> Self

Type property of an absolute timelock. Default implementation simply passes through to from_time
source§

fn cast_alt(self) -> Result<Self, ErrorKind>

Cast using the Alt wrapper
source§

fn cast_swap(self) -> Result<Self, ErrorKind>

Cast using the Swap wrapper
source§

fn cast_check(self) -> Result<Self, ErrorKind>

Cast using the Check wrapper
source§

fn cast_dupif(self) -> Result<Self, ErrorKind>

Cast using the DupIf wrapper
source§

fn cast_verify(self) -> Result<Self, ErrorKind>

Cast using the Verify wrapper
source§

fn cast_nonzero(self) -> Result<Self, ErrorKind>

Cast using the NonZero wrapper
source§

fn cast_zeronotequal(self) -> Result<Self, ErrorKind>

Cast using the ZeroNotEqual wrapper
source§

fn cast_true(self) -> Result<Self, ErrorKind>

Cast by changing [X] to AndV([X], True)
source§

fn cast_or_i_false(self) -> Result<Self, ErrorKind>

Cast by changing [X] to or_i([X], 0) or or_i(0, [X])
source§

fn cast_unlikely(self) -> Result<Self, ErrorKind>

Cast by changing [X] to or_i([X], 0). Default implementation simply passes through to cast_or_i_false
source§

fn cast_likely(self) -> Result<Self, ErrorKind>

Cast by changing [X] to or_i(0, [X]). Default implementation simply passes through to cast_or_i_false
source§

fn and_b(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an AndB fragment
source§

fn and_v(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an AndV fragment
source§

fn or_b(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an OrB fragment
source§

fn or_d(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an OrD fragment
source§

fn or_c(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an OrC fragment
source§

fn or_i(l: Self, r: Self) -> Result<Self, ErrorKind>

Computes the type of an OrI fragment
source§

fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>

Computes the type of an AndOr fragment
source§

fn threshold<S>(k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind>
where S: FnMut(usize) -> Result<Self, ErrorKind>,

Computes the type of an Thresh fragment
source§

fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>

Computes the type of an AndN fragment
source§

impl Copy for ExtData

source§

impl Eq for ExtData

source§

impl StructuralEq for ExtData

source§

impl StructuralPartialEq for ExtData

Auto Trait Implementations§

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

§

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

§

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

§

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.