Struct miniscript::miniscript::types::extra_props::ExtData
source · [−]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 timelock_info: TimeLockInfo,
}
Expand description
Structure representing the extra type properties of a fragment which are relevant to legacy(pre-segwit) safety and fee estimation. If a fragment is used in pre-segwit transactions it will only be malleable but still is correct and sound.
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.
timelock_info: TimeLockInfo
The timelock info about heightlocks and timelocks
Trait Implementations
sourceimpl Ord for ExtData
impl Ord for ExtData
sourceimpl PartialOrd<ExtData> for ExtData
impl PartialOrd<ExtData> for ExtData
sourcefn partial_cmp(&self, other: &ExtData) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl Property for ExtData
impl Property for ExtData
sourcefn 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,
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.
sourcefn sanity_checks(&self)
fn sanity_checks(&self)
Any extra sanity checks/assertions that should be applied after typechecking Read more
sourcefn from_false() -> Self
fn from_false() -> Self
Type property of the False
fragment
sourcefn from_multi(k: usize, n: usize) -> Self
fn from_multi(k: usize, n: usize) -> Self
Type property of a Multi
fragment
sourcefn from_sha256() -> Self
fn from_sha256() -> Self
Type property of a Sha256
hash. Default implementation simply
passes through to from_hash
Read more
sourcefn from_hash256() -> Self
fn from_hash256() -> Self
Type property of a Hash256
hash. Default implementation simply
passes through to from_hash
Read more
sourcefn from_ripemd160() -> Self
fn from_ripemd160() -> Self
Type property of a Ripemd160
hash. Default implementation simply
passes through to from_hash
Read more
sourcefn from_hash160() -> Self
fn from_hash160() -> Self
Type property of a Hash160
hash. Default implementation simply
passes through to from_hash
Read more
sourcefn from_after(t: u32) -> Self
fn from_after(t: u32) -> Self
Type property of a relative timelock. Default implementation simply
passes through to from_time
Read more
sourcefn from_older(t: u32) -> Self
fn from_older(t: u32) -> Self
Type property of an absolute timelock. Default implementation simply
passes through to from_time
Read more
sourcefn cast_check(self) -> Result<Self, ErrorKind>
fn cast_check(self) -> Result<Self, ErrorKind>
Cast using the Check
wrapper
sourcefn cast_dupif(self) -> Result<Self, ErrorKind>
fn cast_dupif(self) -> Result<Self, ErrorKind>
Cast using the DupIf
wrapper
sourcefn cast_verify(self) -> Result<Self, ErrorKind>
fn cast_verify(self) -> Result<Self, ErrorKind>
Cast using the Verify
wrapper
sourcefn cast_nonzero(self) -> Result<Self, ErrorKind>
fn cast_nonzero(self) -> Result<Self, ErrorKind>
Cast using the NonZero
wrapper
sourcefn cast_zeronotequal(self) -> Result<Self, ErrorKind>
fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
Cast using the ZeroNotEqual
wrapper
sourcefn cast_or_i_false(self) -> Result<Self, ErrorKind>
fn cast_or_i_false(self) -> Result<Self, ErrorKind>
Cast by changing [X]
to or_i([X], 0)
or or_i(0, [X])
sourcefn cast_unlikely(self) -> Result<Self, ErrorKind>
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
Read more
sourcefn cast_likely(self) -> Result<Self, ErrorKind>
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
Read more
sourcefn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>
fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>
Computes the type of an AndOr
fragment
fn threshold<S>(k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind> where
S: FnMut(usize) -> Result<Self, ErrorKind>,
impl Copy for ExtData
impl Eq for ExtData
impl StructuralEq for ExtData
impl StructuralPartialEq for ExtData
Auto Trait Implementations
impl RefUnwindSafe for ExtData
impl Send for ExtData
impl Sync for ExtData
impl Unpin for ExtData
impl UnwindSafe for ExtData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more