pub trait Property: Sized {
Show 36 methods
// Required methods
fn from_true() -> Self;
fn from_false() -> Self;
fn from_pk_k<Ctx: ScriptContext>() -> Self;
fn from_pk_h<Ctx: ScriptContext>() -> Self;
fn from_multi(k: usize, n: usize) -> Self;
fn from_multi_a(k: usize, n: usize) -> Self;
fn from_hash() -> Self;
fn from_time(t: u32) -> Self;
fn cast_alt(self) -> Result<Self, ErrorKind>;
fn cast_swap(self) -> Result<Self, ErrorKind>;
fn cast_check(self) -> Result<Self, ErrorKind>;
fn cast_dupif(self) -> Result<Self, ErrorKind>;
fn cast_verify(self) -> Result<Self, ErrorKind>;
fn cast_nonzero(self) -> Result<Self, ErrorKind>;
fn cast_zeronotequal(self) -> Result<Self, ErrorKind>;
fn cast_or_i_false(self) -> Result<Self, ErrorKind>;
fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>;
fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>;
fn threshold<S>(k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind>
where S: FnMut(usize) -> Result<Self, ErrorKind>;
// Provided methods
fn sanity_checks(&self) { ... }
fn from_sha256() -> Self { ... }
fn from_hash256() -> Self { ... }
fn from_ripemd160() -> Self { ... }
fn from_hash160() -> Self { ... }
fn from_after(t: LockTime) -> Self { ... }
fn from_older(t: Sequence) -> Self { ... }
fn cast_true(self) -> Result<Self, ErrorKind> { ... }
fn cast_unlikely(self) -> Result<Self, ErrorKind> { ... }
fn cast_likely(self) -> Result<Self, ErrorKind> { ... }
fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind> { ... }
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 { ... }
}Expand description
Trait representing a type property, which defines how the property propagates from terminals to the root of a Miniscript
Required Methods§
Sourcefn from_false() -> Self
fn from_false() -> Self
Type property of the False fragment
Sourcefn from_pk_k<Ctx: ScriptContext>() -> Self
fn from_pk_k<Ctx: ScriptContext>() -> Self
Type property of the PkK fragment
Sourcefn from_pk_h<Ctx: ScriptContext>() -> Self
fn from_pk_h<Ctx: ScriptContext>() -> Self
Type property of the PkH 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_multi_a(k: usize, n: usize) -> Self
fn from_multi_a(k: usize, n: usize) -> Self
Type property of a MultiA fragment
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 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 fragment
Sourcefn 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 fragment
Sourcefn 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 fragment
Sourcefn 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 fragment
Sourcefn 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 fragment
Sourcefn 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 fragment
Provided Methods§
Sourcefn sanity_checks(&self)
fn sanity_checks(&self)
Any extra sanity checks/assertions that should be applied after typechecking
Sourcefn from_sha256() -> Self
fn from_sha256() -> Self
Type property of a Sha256 hash. Default implementation simply
passes through to from_hash
Sourcefn from_hash256() -> Self
fn from_hash256() -> Self
Type property of a Hash256 hash. Default implementation simply
passes through to from_hash
Sourcefn from_ripemd160() -> Self
fn from_ripemd160() -> Self
Type property of a Ripemd160 hash. Default implementation simply
passes through to from_hash
Sourcefn from_hash160() -> Self
fn from_hash160() -> Self
Type property of a Hash160 hash. Default implementation simply
passes through to from_hash
Sourcefn 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
Sourcefn 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
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
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
Sourcefn 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 fragment
Sourcefn 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, given a function to look up the types of its children, if available and relevant for the given fragment
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.