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§
Source§impl Type
 
impl Type
Sourcepub const fn is_subtype(&self, other: Self) -> bool
 
pub const 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.
Sourcepub fn sanity_checks(&self)
 
pub fn sanity_checks(&self)
Confirm invariants of the type checker.
Sourcepub const fn cast_alt(self) -> Result<Self, ErrorKind>
 
pub const fn cast_alt(self) -> Result<Self, ErrorKind>
Constructor for the type of the a: fragment.
Sourcepub const fn cast_swap(self) -> Result<Self, ErrorKind>
 
pub const fn cast_swap(self) -> Result<Self, ErrorKind>
Constructor for the type of the s: fragment.
Sourcepub const fn cast_check(self) -> Result<Self, ErrorKind>
 
pub const fn cast_check(self) -> Result<Self, ErrorKind>
Constructor for the type of the c: fragment.
Sourcepub const fn cast_dupif(self) -> Result<Self, ErrorKind>
 
pub const fn cast_dupif(self) -> Result<Self, ErrorKind>
Constructor for the type of the d: fragment.
Sourcepub const fn cast_verify(self) -> Result<Self, ErrorKind>
 
pub const fn cast_verify(self) -> Result<Self, ErrorKind>
Constructor for the type of the v: fragment.
Sourcepub const fn cast_nonzero(self) -> Result<Self, ErrorKind>
 
pub const fn cast_nonzero(self) -> Result<Self, ErrorKind>
Constructor for the type of the j: fragment.
Sourcepub const fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
 
pub const fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
Constructor for the type of the n: fragment.
Sourcepub const fn cast_true(self) -> Result<Self, ErrorKind>
 
pub const fn cast_true(self) -> Result<Self, ErrorKind>
Constructor for the type of the t: fragment.
Sourcepub const fn cast_unlikely(self) -> Result<Self, ErrorKind>
 
pub const fn cast_unlikely(self) -> Result<Self, ErrorKind>
Constructor for the type of the u: fragment.
Sourcepub const fn cast_likely(self) -> Result<Self, ErrorKind>
 
pub const fn cast_likely(self) -> Result<Self, ErrorKind>
Constructor for the type of the l: fragment.
Sourcepub const fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the and_b fragment.
Sourcepub const fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the and_v fragment.
Sourcepub const fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the or_b fragment.
Sourcepub const fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the or_b fragment.
Sourcepub const fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the or_c fragment.
Sourcepub const fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
 
pub const fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the type of the or_i fragment.
Source§impl Type
 
impl Type
Sourcepub fn type_check<Pk, Ctx>(fragment: &Terminal<Pk, Ctx>) -> Result<Self, Error>where
    Pk: MiniscriptKey,
    Ctx: ScriptContext,
 
pub fn type_check<Pk, Ctx>(fragment: &Terminal<Pk, Ctx>) -> Result<Self, Error>where
    Pk: MiniscriptKey,
    Ctx: ScriptContext,
Compute the type of a fragment assuming all the children of Miniscript have been computed already.