Struct miniscript::miniscript::types::malleability::Malleability
source · Expand description
Structure representing the type properties of a fragment which have relevance to malleability analysis
Fields
dissat: Dissat
Properties of dissatisfying inputs
safe: bool
true
if satisfactions cannot be created by any 3rd party
who has not yet seen a satisfaction. (Hash preimages and
signature checks are safe; timelocks are not.) Affects
malleability.
non_malleable: bool
Whether a non-malleable satisfaction is guaranteed to exist for the fragment
Implementations
sourceimpl Malleability
impl Malleability
sourcepub fn is_subtype(&self, other: Self) -> bool
pub fn is_subtype(&self, other: Self) -> bool
Check whether the self
is a subtype of other
argument .
This checks whether the argument other
has attributes which are present
in the given Type
. This returns true
on same arguments
a.is_subtype(a)
is true
.
Trait Implementations
sourceimpl Clone for Malleability
impl Clone for Malleability
sourcefn clone(&self) -> Malleability
fn clone(&self) -> Malleability
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Malleability
impl Debug for Malleability
sourceimpl Hash for Malleability
impl Hash for Malleability
sourceimpl Ord for Malleability
impl Ord for Malleability
sourcefn cmp(&self, other: &Malleability) -> Ordering
fn cmp(&self, other: &Malleability) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Malleability> for Malleability
impl PartialEq<Malleability> for Malleability
sourcefn eq(&self, other: &Malleability) -> bool
fn eq(&self, other: &Malleability) -> bool
sourceimpl PartialOrd<Malleability> for Malleability
impl PartialOrd<Malleability> for Malleability
sourcefn partial_cmp(&self, other: &Malleability) -> Option<Ordering>
fn partial_cmp(&self, other: &Malleability) -> Option<Ordering>
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 moresourceimpl Property for Malleability
impl Property for Malleability
sourcefn from_false() -> Self
fn from_false() -> Self
Type property of the
False
fragmentsourcefn from_pk_k<Ctx: ScriptContext>() -> Self
fn from_pk_k<Ctx: ScriptContext>() -> Self
Type property of the
PkK
fragmentsourcefn from_pk_h<Ctx: ScriptContext>() -> Self
fn from_pk_h<Ctx: ScriptContext>() -> Self
Type property of the
PkH
fragmentsourcefn from_multi(_: usize, _: usize) -> Self
fn from_multi(_: usize, _: usize) -> Self
Type property of a
Multi
fragmentsourcefn cast_check(self) -> Result<Self, ErrorKind>
fn cast_check(self) -> Result<Self, ErrorKind>
Cast using the
Check
wrappersourcefn cast_dupif(self) -> Result<Self, ErrorKind>
fn cast_dupif(self) -> Result<Self, ErrorKind>
Cast using the
DupIf
wrappersourcefn cast_verify(self) -> Result<Self, ErrorKind>
fn cast_verify(self) -> Result<Self, ErrorKind>
Cast using the
Verify
wrappersourcefn cast_nonzero(self) -> Result<Self, ErrorKind>
fn cast_nonzero(self) -> Result<Self, ErrorKind>
Cast using the
NonZero
wrappersourcefn cast_zeronotequal(self) -> Result<Self, ErrorKind>
fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
Cast using the
ZeroNotEqual
wrappersourcefn 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 and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
AndB
fragmentsourcefn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
AndV
fragmentsourcefn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
OrB
fragmentsourcefn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
OrD
fragmentsourcefn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
OrC
fragmentsourcefn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
OrI
fragmentsourcefn 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
fragmentsourcefn threshold<S>(k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind>where
S: FnMut(usize) -> Result<Self, ErrorKind>,
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
fragmentsourcefn sanity_checks(&self)
fn sanity_checks(&self)
Any extra sanity checks/assertions that should be applied after
typechecking Read more
sourcefn from_multi_a(k: usize, n: usize) -> Self
fn from_multi_a(k: usize, n: usize) -> Self
Type property of a
MultiA
fragmentsourcefn from_sha256() -> Self
fn from_sha256() -> Self
sourcefn from_hash256() -> Self
fn from_hash256() -> Self
Type property of a
Hash256
hash. Default implementation simply
passes through to from_hash
Read moresourcefn from_ripemd160() -> Self
fn from_ripemd160() -> Self
Type property of a
Ripemd160
hash. Default implementation simply
passes through to from_hash
Read moresourcefn from_hash160() -> Self
fn from_hash160() -> Self
Type property of a
Hash160
hash. Default implementation simply
passes through to from_hash
Read moresourcefn from_after(t: LockTime) -> Self
fn from_after(t: LockTime) -> Self
Type property of an absolute timelock. Default implementation simply
passes through to
from_time
Read moresourcefn from_older(t: Sequence) -> Self
fn from_older(t: Sequence) -> Self
Type property of a relative timelock. Default implementation simply
passes through to
from_time
Read moresourcefn 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 moresourcefn 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 moresourcefn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>
Computes the type of an
AndN
fragmentsourcefn type_check<Pk, Ctx, C>(
fragment: &Terminal<Pk, Ctx>,
child: C
) -> Result<Self, Error<Pk, Ctx>>where
C: FnMut(usize) -> Option<Self>,
Pk: MiniscriptKey,
Ctx: ScriptContext,
fn type_check<Pk, Ctx, C>(
fragment: &Terminal<Pk, Ctx>,
child: C
) -> Result<Self, Error<Pk, Ctx>>where
C: FnMut(usize) -> Option<Self>,
Pk: MiniscriptKey,
Ctx: ScriptContext,
Compute the type of a fragment, given a function to look up
the types of its children, if available and relevant for the
given fragment Read more
impl Copy for Malleability
impl Eq for Malleability
impl StructuralEq for Malleability
impl StructuralPartialEq for Malleability
Auto Trait Implementations
impl RefUnwindSafe for Malleability
impl Send for Malleability
impl Sync for Malleability
impl Unpin for Malleability
impl UnwindSafe for Malleability
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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