[][src]Trait miniscript::miniscript::types::Property

pub trait Property: Sized {
    pub fn from_true() -> Self;
pub fn from_false() -> Self;
pub fn from_pk_k() -> Self;
pub fn from_pk_h() -> Self;
pub fn from_multi(k: usize, n: usize) -> Self;
pub fn from_hash() -> Self;
pub fn from_time(t: u32) -> Self;
pub fn cast_alt(self) -> Result<Self, ErrorKind>;
pub fn cast_swap(self) -> Result<Self, ErrorKind>;
pub fn cast_check(self) -> Result<Self, ErrorKind>;
pub fn cast_dupif(self) -> Result<Self, ErrorKind>;
pub fn cast_verify(self) -> Result<Self, ErrorKind>;
pub fn cast_nonzero(self) -> Result<Self, ErrorKind>;
pub fn cast_zeronotequal(self) -> Result<Self, ErrorKind>;
pub fn cast_true(self) -> Result<Self, ErrorKind>;
pub fn cast_or_i_false(self) -> Result<Self, ErrorKind>;
pub fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>;
pub fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>;
pub fn threshold<S>(
        k: usize,
        n: usize,
        sub_ck: S
    ) -> Result<Self, ErrorKind>
    where
        S: FnMut(usize) -> Result<Self, ErrorKind>
; pub fn sanity_checks(&self) { ... }
pub fn from_sha256() -> Self { ... }
pub fn from_hash256() -> Self { ... }
pub fn from_ripemd160() -> Self { ... }
pub fn from_hash160() -> Self { ... }
pub fn from_after(t: u32) -> Self { ... }
pub fn from_older(t: u32) -> Self { ... }
pub fn cast_unlikely(self) -> Result<Self, ErrorKind> { ... }
pub fn cast_likely(self) -> Result<Self, ErrorKind> { ... }
pub fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind> { ... }
pub fn type_check<Pk, Ctx, C>(
        fragment: &Terminal<Pk, Ctx>,
        mut child: C
    ) -> Result<Self, Error<Pk, Ctx>>
    where
        C: FnMut(usize) -> Option<Self>,
        Pk: MiniscriptKey,
        Ctx: ScriptContext
, { ... } }

Trait representing a type property, which defines how the property propagates from terminals to the root of a Miniscript

Required methods

pub fn from_true() -> Self[src]

Type property of the True fragment

pub fn from_false() -> Self[src]

Type property of the False fragment

pub fn from_pk_k() -> Self[src]

Type property of the PkK fragment

pub fn from_pk_h() -> Self[src]

Type property of the PkH fragment

pub fn from_multi(k: usize, n: usize) -> Self[src]

Type property of a Multi fragment

pub fn from_hash() -> Self[src]

Type property of a hash fragment

pub fn from_time(t: u32) -> Self[src]

Type property of a timelock

pub fn cast_alt(self) -> Result<Self, ErrorKind>[src]

Cast using the Alt wrapper

pub fn cast_swap(self) -> Result<Self, ErrorKind>[src]

Cast using the Swap wrapper

pub fn cast_check(self) -> Result<Self, ErrorKind>[src]

Cast using the Check wrapper

pub fn cast_dupif(self) -> Result<Self, ErrorKind>[src]

Cast using the DupIf wrapper

pub fn cast_verify(self) -> Result<Self, ErrorKind>[src]

Cast using the Verify wrapper

pub fn cast_nonzero(self) -> Result<Self, ErrorKind>[src]

Cast using the NonZero wrapper

pub fn cast_zeronotequal(self) -> Result<Self, ErrorKind>[src]

Cast using the ZeroNotEqual wrapper

pub fn cast_true(self) -> Result<Self, ErrorKind>[src]

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

pub fn cast_or_i_false(self) -> Result<Self, ErrorKind>[src]

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

pub fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an AndB fragment

pub fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an AndV fragment

pub fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an OrB fragment

pub fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an OrD fragment

pub fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an OrC fragment

pub fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an OrI fragment

pub fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an AndOr fragment

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

Computes the type of an Thresh fragment

Loading content...

Provided methods

pub fn sanity_checks(&self)[src]

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

pub fn from_sha256() -> Self[src]

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

pub fn from_hash256() -> Self[src]

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

pub fn from_ripemd160() -> Self[src]

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

pub fn from_hash160() -> Self[src]

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

pub fn from_after(t: u32) -> Self[src]

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

pub fn from_older(t: u32) -> Self[src]

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

pub fn cast_unlikely(self) -> Result<Self, ErrorKind>[src]

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

pub fn cast_likely(self) -> Result<Self, ErrorKind>[src]

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

pub fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>[src]

Computes the type of an AndN fragment

pub fn type_check<Pk, Ctx, C>(
    fragment: &Terminal<Pk, Ctx>,
    mut child: C
) -> Result<Self, Error<Pk, Ctx>> where
    C: FnMut(usize) -> Option<Self>,
    Pk: MiniscriptKey,
    Ctx: ScriptContext
[src]

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

Loading content...

Implementors

impl Property for Correctness[src]

impl Property for ExtData[src]

pub 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
[src]

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

impl Property for Malleability[src]

impl Property for Type[src]

pub 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
[src]

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

Loading content...