Struct bdk::descriptor::Miniscript
source · pub struct Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,{
pub node: Terminal<Pk, Ctx>,
pub ty: Type,
pub ext: ExtData,
/* private fields */
}
Expand description
Top-level script AST type
Fields
node: Terminal<Pk, Ctx>
A node in the Abstract Syntax Tree(
ty: Type
The correctness and malleability type information for the AST node
ext: ExtData
Additional information helpful for extra analysis.
Implementations
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourcepub fn requires_sig(&self) -> bool
pub fn requires_sig(&self) -> bool
Whether all spend paths of miniscript require a signature
sourcepub fn is_non_malleable(&self) -> bool
pub fn is_non_malleable(&self) -> bool
Whether the miniscript is malleable
sourcepub fn within_resource_limits(&self) -> bool
pub fn within_resource_limits(&self) -> bool
Whether the miniscript can exceed the resource limits(Opcodes, Stack limit etc)
sourcepub fn has_mixed_timelocks(&self) -> bool
pub fn has_mixed_timelocks(&self) -> bool
Whether the miniscript contains a combination of timelocks
sourcepub fn has_repeated_keys(&self) -> bool
pub fn has_repeated_keys(&self) -> bool
Whether the miniscript has repeated Pk or Pkh
sourcepub fn contains_raw_pkh(&self) -> bool
pub fn contains_raw_pkh(&self) -> bool
Whether the given miniscript contains a raw pkh fragment
sourcepub fn sanity_check(&self) -> Result<(), AnalysisError>
pub fn sanity_check(&self) -> Result<(), AnalysisError>
Check whether the underlying Miniscript is safe under the current context Lifting these polices would create a semantic representation that does not represent the underlying semantics when miniscript is spent. Signing logic may not find satisfaction even if one exists.
For most cases, users should be dealing with safe scripts. Use this function to check whether the guarantees of library hold. Most functions of the library like would still work, but results cannot be relied upon
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
Iterator-related extensions for Miniscript
sourcepub fn iter(&self) -> Iter<'_, Pk, Ctx>
pub fn iter(&self) -> Iter<'_, Pk, Ctx>
Creates a new Iter iterator that will iterate over all Miniscript items within AST by traversing its branches. For the specific algorithm please see Iter::next function.
sourcepub fn iter_pk(&self) -> PkIter<'_, Pk, Ctx>
pub fn iter_pk(&self) -> PkIter<'_, Pk, Ctx>
Creates a new PkIter iterator that will iterate over all plain public keys (and not key hash values) present in Miniscript items within AST by traversing all its branches. For the specific algorithm please see PkIter::next function.
sourcepub fn branches(&self) -> Vec<&Miniscript<Pk, Ctx>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn branches(&self) -> Vec<&Miniscript<Pk, Ctx>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Enumerates all child nodes of the current AST node (self
) and returns a Vec
referencing
them.
sourcepub fn get_nth_child(&self, n: usize) -> Option<&Miniscript<Pk, Ctx>>
pub fn get_nth_child(&self, n: usize) -> Option<&Miniscript<Pk, Ctx>>
Returns child node with given index, if any
sourcepub fn get_nth_pk(&self, n: usize) -> Option<Pk>
pub fn get_nth_pk(&self, n: usize) -> Option<Pk>
Returns Option::Some
with cloned n’th public key from the current miniscript item,
if any. Otherwise returns Option::None
.
NB: The function analyzes only single miniscript item and not any of its descendants in AST.
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Ctx> Miniscript<<Ctx as ScriptContext>::Key, Ctx>where
Ctx: ScriptContext,
impl<Ctx> Miniscript<<Ctx as ScriptContext>::Key, Ctx>where
Ctx: ScriptContext,
sourcepub fn parse_insane(
script: &Script
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
pub fn parse_insane(
script: &Script
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
Attempt to parse an insane(scripts don’t clear sanity checks) script into a Miniscript representation. Use this to parse scripts with repeated pubkeys, timelock mixing, malleable scripts without sig or scripts that can exceed resource limits. Some of the analysis guarantees of miniscript are lost when dealing with insane scripts. In general, in a multi-party setting users should only accept sane scripts.
sourcepub fn parse_with_ext(
script: &Script,
ext: &ExtParams
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
pub fn parse_with_ext(
script: &Script,
ext: &ExtParams
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
Attempt to parse an miniscript with extra features that not yet specified in the spec. Users should not use this function unless they scripts can/will change in the future. Currently, this function supports the following features: - Parsing all insane scripts - Parsing miniscripts with raw pubkey hashes
Allowed extra features can be specified by the ext ExtParams
argument.
sourcepub fn parse(
script: &Script
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
pub fn parse(
script: &Script
) -> Result<Miniscript<<Ctx as ScriptContext>::Key, Ctx>, Error>
Attempt to parse a Script into Miniscript representation.
This function will fail parsing for scripts that do not clear the
Miniscript::sanity_check
checks. Use Miniscript::parse_insane
to
parse such scripts.
Decode/Parse a miniscript from script hex
use miniscript::{Miniscript, Segwitv0, Tap};
use miniscript::bitcoin::secp256k1::XOnlyPublicKey;
use miniscript::bitcoin::hashes::hex::FromHex;
type Segwitv0Script = Miniscript<bitcoin::PublicKey, Segwitv0>;
type TapScript = Miniscript<XOnlyPublicKey, Tap>;
// parse x-only miniscript in Taproot context
let tapscript_ms = TapScript::parse(&bitcoin::Script::from(Vec::<u8>::from_hex(
"202788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99ac",
).expect("Even length hex")))
.expect("Xonly keys are valid only in taproot context");
// tapscript fails decoding when we use them with compressed keys
let err = TapScript::parse(&bitcoin::Script::from(Vec::<u8>::from_hex(
"21022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99ac",
).expect("Even length hex")))
.expect_err("Compressed keys cannot be used in Taproot context");
// Segwitv0 succeeds decoding with full keys.
Segwitv0Script::parse(&bitcoin::Script::from(Vec::<u8>::from_hex(
"21022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99ac",
).expect("Even length hex")))
.expect("Compressed keys are allowed in Segwit context");
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourcepub fn encode(&self) -> Scriptwhere
Pk: ToPublicKey,
pub fn encode(&self) -> Scriptwhere
Pk: ToPublicKey,
Encode as a Bitcoin script
sourcepub fn script_size(&self) -> usize
pub fn script_size(&self) -> usize
Size, in bytes of the script-pubkey. If this Miniscript is used outside of segwit (e.g. in a bare or P2SH descriptor), this quantity should be multiplied by 4 to compute the weight.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourcepub fn max_satisfaction_witness_elements(&self) -> Result<usize, Error>
pub fn max_satisfaction_witness_elements(&self) -> Result<usize, Error>
Maximum number of witness elements used to satisfy the Miniscript
fragment, including the witness script itself. Used to estimate
the weight of the VarInt
that specifies this number in a serialized
transaction.
This function may returns Error when the Miniscript is impossible to satisfy
sourcepub fn max_satisfaction_size(&self) -> Result<usize, Error>
pub fn max_satisfaction_size(&self) -> Result<usize, Error>
Maximum size, in bytes, of a satisfying witness. For Segwit outputs
one_cost
should be set to 2, since the number 1
requires two
bytes to encode. For non-segwit outputs one_cost
should be set to
1, since OP_1
is available in scriptSigs.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
All signatures are assumed to be 73 bytes in size, including the length prefix (segwit) or push opcode (pre-segwit) and sighash postfix.
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
sourcepub fn from_str_insane(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>
pub fn from_str_insane(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>
Attempt to parse an insane(scripts don’t clear sanity checks) from string into a Miniscript representation. Use this to parse scripts with repeated pubkeys, timelock mixing, malleable scripts without sig or scripts that can exceed resource limits. Some of the analysis guarantees of miniscript are lost when dealing with insane scripts. In general, in a multi-party setting users should only accept sane scripts.
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
sourcepub fn from_str_ext(
s: &str,
ext: &ExtParams
) -> Result<Miniscript<Pk, Ctx>, Error>
pub fn from_str_ext(
s: &str,
ext: &ExtParams
) -> Result<Miniscript<Pk, Ctx>, Error>
Attempt to parse an Miniscripts that don’t follow the spec. Use this to parse scripts with repeated pubkeys, timelock mixing, malleable scripts, raw pubkey hashes without sig or scripts that can exceed resource limits.
Use ExtParams
builder to specify the types of non-sane rules to allow while parsing.
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourcepub fn lift_check(&self) -> Result<(), LiftError>
pub fn lift_check(&self) -> Result<(), LiftError>
Lifting corresponds conversion of miniscript into Policy [policy.semantic.Policy] for human readable or machine analysis. However, naively lifting miniscripts can result in incorrect interpretations that don’t correspond underlying semantics when we try to spend them on bitcoin network. This can occur if the miniscript contains a
- Timelock combination
- Contains a spend that exceeds resource limits
Trait Implementations
sourceimpl<Pk, Ctx> Clone for Miniscript<Pk, Ctx>where
Pk: Clone + MiniscriptKey,
Ctx: Clone + ScriptContext,
impl<Pk, Ctx> Clone for Miniscript<Pk, Ctx>where
Pk: Clone + MiniscriptKey,
Ctx: Clone + ScriptContext,
sourcefn clone(&self) -> Miniscript<Pk, Ctx>
fn clone(&self) -> Miniscript<Pk, Ctx>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<Pk, Ctx> Debug for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Debug for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<'de, Pk, Ctx> Deserialize<'de> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: Display,
Ctx: ScriptContext,
impl<'de, Pk, Ctx> Deserialize<'de> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: Display,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: Display,
Ctx: ScriptContext,
sourcefn deserialize<D>(
deserializer: D
) -> Result<Miniscript<Pk, Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Miniscript<Pk, Ctx>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
sourceimpl<Pk, Ctx> Display for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Display for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Ctx: ScriptContext + 'static> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>
impl<Ctx: ScriptContext + 'static> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>
sourcefn extract_policy(
&self,
signers: &SignersContainer,
build_sat: BuildSatisfaction<'_>,
secp: &Secp256k1<All>
) -> Result<Option<Policy>, Error>
fn extract_policy(
&self,
signers: &SignersContainer,
build_sat: BuildSatisfaction<'_>,
secp: &Secp256k1<All>
) -> Result<Option<Policy>, Error>
policy
sourceimpl<Pk, Ctx> ForEachKey<Pk> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> ForEachKey<Pk> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> FromStr for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
impl<Pk, Ctx> FromStr for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
sourcefn from_str(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>
fn from_str(s: &str) -> Result<Miniscript<Pk, Ctx>, Error>
Parse a Miniscript from string and perform sanity checks See Miniscript::from_str_insane to parse scripts from string that do not clear the Miniscript::sanity_check checks.
sourceimpl<Pk, Ctx> FromTree for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
impl<Pk, Ctx> FromTree for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey + FromStr,
<Pk as MiniscriptKey>::Sha256: FromStr,
<Pk as MiniscriptKey>::Hash256: FromStr,
<Pk as MiniscriptKey>::Ripemd160: FromStr,
<Pk as MiniscriptKey>::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> Hash for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Hash for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> Liftable<Pk> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Liftable<Pk> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourceimpl<Pk, Ctx> Ord for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Ord for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
Ord
of Miniscript
must depend only on node and not the type information.
The type information and extra_properties can be deterministically determined
by the ast.
sourcefn cmp(&self, other: &Miniscript<Pk, Ctx>) -> Ordering
fn cmp(&self, other: &Miniscript<Pk, Ctx>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
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>,
sourceimpl<Pk, Ctx> PartialEq<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> PartialEq<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
PartialEq
of Miniscript
must depend only on node and not the type information.
The type information and extra_properties can be deterministically determined
by the ast.
sourcefn eq(&self, other: &Miniscript<Pk, Ctx>) -> bool
fn eq(&self, other: &Miniscript<Pk, Ctx>) -> bool
sourceimpl<Pk, Ctx> PartialOrd<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> PartialOrd<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
PartialOrd
of Miniscript
must depend only on node and not the type information.
The type information and extra_properties can be deterministically determined
by the ast.
sourcefn partial_cmp(&self, other: &Miniscript<Pk, Ctx>) -> Option<Ordering>
fn partial_cmp(&self, other: &Miniscript<Pk, Ctx>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<'de, Pk, Ctx> Serialize for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<'de, Pk, Ctx> Serialize for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
sourceimpl<Pk, Q, Ctx> TranslatePk<Pk, Q> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Q: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Q, Ctx> TranslatePk<Pk, Q> for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Q: MiniscriptKey,
Ctx: ScriptContext,
sourcefn translate_pk<T, E>(
&self,
translate: &mut T
) -> Result<<Miniscript<Pk, Ctx> as TranslatePk<Pk, Q>>::Output, E>where
T: Translator<Pk, Q, E>,
fn translate_pk<T, E>(
&self,
translate: &mut T
) -> Result<<Miniscript<Pk, Ctx> as TranslatePk<Pk, Q>>::Output, E>where
T: Translator<Pk, Q, E>,
Translates a struct from one generic to another where the translation
for Pk is provided by Translator
type Output = Miniscript<Q, Ctx>
type Output = Miniscript<Q, Ctx>
Self<Q>
.impl<Pk, Ctx> Eq for Miniscript<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
Eq
of Miniscript
must depend only on node and not the type information.
The type information and extra_properties can be deterministically determined
by the ast.