Struct miniscript::miniscript::types::Type   
source · pub struct Type {
    pub corr: Correctness,
    pub mall: Malleability,
}Expand description
Structure representing the type of a Miniscript fragment, including all properties relevant to the main codebase
Fields§
§corr: CorrectnessCorrectness/soundness properties
mall: MalleabilityMalleability properties
Implementations§
Trait Implementations§
source§impl Ord for Type
 
impl Ord for Type
source§impl PartialEq for Type
 
impl PartialEq for Type
source§impl PartialOrd for Type
 
impl PartialOrd for Type
1.0.0 · source§fn 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 moresource§impl Property for Type
 
impl Property for Type
source§fn type_check<Pk, Ctx, C>(
    fragment: &Terminal<Pk, Ctx>,
    _child: C,
) -> Result<Self, Error<Pk, Ctx>>
 
fn type_check<Pk, Ctx, C>( fragment: &Terminal<Pk, Ctx>, _child: C, ) -> Result<Self, Error<Pk, Ctx>>
Compute the type of a fragment assuming all the children of Miniscript have been computed already.
source§fn sanity_checks(&self)
 
fn sanity_checks(&self)
Any extra sanity checks/assertions that should be applied after
typechecking
source§fn from_false() -> Self
 
fn from_false() -> Self
Type property of the 
False fragmentsource§fn from_pk_k<Ctx: ScriptContext>() -> Self
 
fn from_pk_k<Ctx: ScriptContext>() -> Self
Type property of the 
PkK fragmentsource§fn from_pk_h<Ctx: ScriptContext>() -> Self
 
fn from_pk_h<Ctx: ScriptContext>() -> Self
Type property of the 
PkH fragmentsource§fn from_multi(k: usize, n: usize) -> Self
 
fn from_multi(k: usize, n: usize) -> Self
Type property of a 
Multi fragmentsource§fn from_multi_a(k: usize, n: usize) -> Self
 
fn from_multi_a(k: usize, n: usize) -> Self
Type property of a 
MultiA fragmentsource§fn from_sha256() -> Self
 
fn from_sha256() -> Self
Type property of a 
Sha256 hash. Default implementation simply
passes through to from_hashsource§fn from_hash256() -> Self
 
fn from_hash256() -> Self
Type property of a 
Hash256 hash. Default implementation simply
passes through to from_hashsource§fn from_ripemd160() -> Self
 
fn from_ripemd160() -> Self
Type property of a 
Ripemd160 hash. Default implementation simply
passes through to from_hashsource§fn from_hash160() -> Self
 
fn from_hash160() -> Self
Type property of a 
Hash160 hash. Default implementation simply
passes through to from_hashsource§fn from_after(t: LockTime) -> Self
 
fn from_after(t: LockTime) -> Self
Type property of an absolute timelock. Default implementation simply
passes through to 
from_timesource§fn from_older(t: Sequence) -> Self
 
fn from_older(t: Sequence) -> Self
Type property of a relative timelock. Default implementation simply
passes through to 
from_timesource§fn cast_check(self) -> Result<Self, ErrorKind>
 
fn cast_check(self) -> Result<Self, ErrorKind>
Cast using the 
Check wrappersource§fn cast_dupif(self) -> Result<Self, ErrorKind>
 
fn cast_dupif(self) -> Result<Self, ErrorKind>
Cast using the 
DupIf wrappersource§fn cast_verify(self) -> Result<Self, ErrorKind>
 
fn cast_verify(self) -> Result<Self, ErrorKind>
Cast using the 
Verify wrappersource§fn cast_nonzero(self) -> Result<Self, ErrorKind>
 
fn cast_nonzero(self) -> Result<Self, ErrorKind>
Cast using the 
NonZero wrappersource§fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
 
fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
Cast using the 
ZeroNotEqual wrappersource§fn 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])source§fn 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_falsesource§fn 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_falsesource§fn 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 fragmentsource§fn 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 fragmentsource§fn 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 fragmentsource§fn 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 fragmentsource§fn 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 fragmentsource§fn 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 fragmentsource§fn 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 fragmentimpl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
 
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
    T: Copy,
 
impl<T> CloneToUninit for Twhere
    T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)