Struct sapio_miniscript::miniscript::Miniscript
source · [−]pub struct Miniscript<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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
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 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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
Iterator-related extensions for Miniscript
sourcepub fn iter(&self) -> Iter<'_, Pk, Ctx>ⓘNotable traits for Iter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for Iter<'a, Pk, Ctx> type Item = &'a Miniscript<Pk, Ctx>;
pub fn iter(&self) -> Iter<'_, Pk, Ctx>ⓘNotable traits for Iter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for Iter<'a, Pk, Ctx> type Item = &'a Miniscript<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>ⓘNotable traits for PkIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkIter<'a, Pk, Ctx> type Item = Pk;
pub fn iter_pk(&self) -> PkIter<'_, Pk, Ctx>ⓘNotable traits for PkIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkIter<'a, Pk, Ctx> type Item = Pk;
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 iter_pkh(&self) -> PkhIter<'_, Pk, Ctx>ⓘNotable traits for PkhIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkhIter<'a, Pk, Ctx> type Item = Pk::Hash;
pub fn iter_pkh(&self) -> PkhIter<'_, Pk, Ctx>ⓘNotable traits for PkhIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkhIter<'a, Pk, Ctx> type Item = Pk::Hash;
Creates a new PkhIter iterator that will iterate over all public keys hashes (and not plain public keys) present in Miniscript items within AST by traversing all its branches. For the specific algorithm please see PkhIter::next function.
sourcepub fn iter_pk_pkh(&self) -> PkPkhIter<'_, Pk, Ctx>ⓘNotable traits for PkPkhIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkPkhIter<'a, Pk, Ctx> type Item = PkPkh<Pk>;
pub fn iter_pk_pkh(&self) -> PkPkhIter<'_, Pk, Ctx>ⓘNotable traits for PkPkhIter<'a, Pk, Ctx>impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkPkhIter<'a, Pk, Ctx> type Item = PkPkh<Pk>;
Creates a new PkPkhIter iterator that will iterate over all plain public keys and key hash values present in Miniscript items within AST by traversing all its branches. For the specific algorithm please see PkPkhIter::next function.
sourcepub fn branches(&self) -> Vec<&Miniscript<Pk, Ctx>>
pub fn branches(&self) -> Vec<&Miniscript<Pk, Ctx>>
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_leaf_pk(&self) -> Vec<Pk>
pub fn get_leaf_pk(&self) -> Vec<Pk>
Returns Vec
with cloned version of all public keys from the current miniscript item,
if any. Otherwise returns an empty Vec
.
NB: The function analyzes only single miniscript item and not any of its descendants in AST.
To obtain a list of all public keys within AST use Miniscript::iter_pk() function, for example
miniscript.iter_pubkeys().collect()
.
sourcepub fn get_leaf_pkh(&self) -> Vec<Pk::Hash>
pub fn get_leaf_pkh(&self) -> Vec<Pk::Hash>
Returns Vec
with hashes of all public keys from the current miniscript item, if any.
Otherwise returns an empty Vec
.
For each public key the function computes hash; for each hash of the public key the function returns its cloned copy.
NB: The function analyzes only single miniscript item and not any of its descendants in AST.
To obtain a list of all public key hashes within AST use Miniscript::iter_pkh() function,
for example miniscript.iter_pubkey_hashes().collect()
.
sourcepub fn get_leaf_pk_pkh(&self) -> Vec<PkPkh<Pk>>
pub fn get_leaf_pk_pkh(&self) -> Vec<PkPkh<Pk>>
Returns Vec
of PkPkh entries, representing either public keys or public key
hashes, depending on the data from the current miniscript item. If there is no public
keys or hashes, the function returns an empty Vec
.
NB: The function analyzes only single miniscript item and not any of its descendants in AST.
To obtain a list of all public keys or hashes within AST use Miniscript::iter_pk_pkh()
function, for example miniscript.iter_pubkeys_and_hashes().collect()
.
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.
sourcepub fn get_nth_pkh(&self, n: usize) -> Option<Pk::Hash>
pub fn get_nth_pkh(&self, n: usize) -> Option<Pk::Hash>
Returns Option::Some
with hash of n’th public key from the current miniscript item,
if any. Otherwise returns Option::None
.
For each public key the function computes hash; for each hash of the public key the function returns it cloned copy.
NB: The function analyzes only single miniscript item and not any of its descendants in AST.
sourcepub fn get_nth_pk_pkh(&self, n: usize) -> Option<PkPkh<Pk>>
pub fn get_nth_pk_pkh(&self, n: usize) -> Option<PkPkh<Pk>>
Returns Option::Some
with hash of n’th public key or hash 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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
sourceimpl<Ctx: ScriptContext> Miniscript<PublicKey, Ctx>
impl<Ctx: ScriptContext> Miniscript<PublicKey, Ctx>
sourcepub fn parse_insane(
script: &Script
) -> Result<Miniscript<PublicKey, Ctx>, Error>
pub fn parse_insane(
script: &Script
) -> Result<Miniscript<PublicKey, 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(script: &Script) -> Result<Miniscript<PublicKey, Ctx>, Error>
pub fn parse(script: &Script) -> Result<Miniscript<PublicKey, 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.
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) -> Script where
Pk: ToPublicKey,
pub fn encode(&self) -> Script where
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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
sourcepub fn from_str_insane(s: &str) -> Result<Miniscript<Pk, Ctx>, Error> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
pub fn from_str_insane(s: &str) -> Result<Miniscript<Pk, Ctx>, Error> where
Pk: FromStr,
Pk::Hash: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
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: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
sourcepub fn satisfy<S: Satisfier<Pk>>(
&self,
satisfier: S
) -> Result<Vec<Vec<u8>>, Error> where
Pk: ToPublicKey,
pub fn satisfy<S: Satisfier<Pk>>(
&self,
satisfier: S
) -> Result<Vec<Vec<u8>>, Error> where
Pk: ToPublicKey,
Attempt to produce non-malleable satisfying witness for the witness script represented by the parse tree
sourcepub fn satisfy_malleable<S: Satisfier<Pk>>(
&self,
satisfier: S
) -> Result<Vec<Vec<u8>>, Error> where
Pk: ToPublicKey,
pub fn satisfy_malleable<S: Satisfier<Pk>>(
&self,
satisfier: S
) -> Result<Vec<Vec<u8>>, Error> where
Pk: ToPublicKey,
Attempt to produce a malleable satisfying witness for the witness script represented by the parse tree
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx>
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: Clone + MiniscriptKey, Ctx: Clone + ScriptContext> Clone for Miniscript<Pk, Ctx>
impl<Pk: Clone + MiniscriptKey, Ctx: Clone + ScriptContext> Clone for Miniscript<Pk, Ctx>
sourcefn clone(&self) -> Miniscript<Pk, Ctx>
fn clone(&self) -> Miniscript<Pk, Ctx>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Debug for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Debug for Miniscript<Pk, Ctx>
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Display for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Display for Miniscript<Pk, Ctx>
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Miniscript<Pk, Ctx>
sourceimpl<Pk, Ctx> FromStr for Miniscript<Pk, Ctx> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
Ctx: ScriptContext,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk, Ctx> FromStr for Miniscript<Pk, Ctx> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
Ctx: ScriptContext,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
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::Hash: FromStr,
Ctx: ScriptContext,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
impl<Pk, Ctx> FromTree for Miniscript<Pk, Ctx> where
Pk: MiniscriptKey + FromStr,
Pk::Hash: FromStr,
Ctx: ScriptContext,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,
sourceimpl<Pk: Hash + MiniscriptKey, Ctx: Hash + ScriptContext> Hash for Miniscript<Pk, Ctx>
impl<Pk: Hash + MiniscriptKey, Ctx: Hash + ScriptContext> Hash for Miniscript<Pk, Ctx>
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for Miniscript<Pk, Ctx>
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> Ord for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Ord for Miniscript<Pk, Ctx>
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.
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialEq<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialEq<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>
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.
sourceimpl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialOrd<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialOrd<Miniscript<Pk, Ctx>> for Miniscript<Pk, Ctx>
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<Pk: MiniscriptKey, Q: MiniscriptKey, Ctx: ScriptContext> TranslatePk<Pk, Q> for Miniscript<Pk, Ctx>
impl<Pk: MiniscriptKey, Q: MiniscriptKey, Ctx: ScriptContext> TranslatePk<Pk, Q> for Miniscript<Pk, Ctx>
sourcefn translate_pk<FPk, FPkh, FuncError>(
&self,
translatefpk: FPk,
translatefpkh: FPkh
) -> Result<Self::Output, FuncError> where
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
FPkh: FnMut(&Pk::Hash) -> Result<Q::Hash, FuncError>,
fn translate_pk<FPk, FPkh, FuncError>(
&self,
translatefpk: FPk,
translatefpkh: FPkh
) -> Result<Self::Output, FuncError> where
FPk: FnMut(&Pk) -> Result<Q, FuncError>,
FPkh: FnMut(&Pk::Hash) -> Result<Q::Hash, FuncError>,
This will panic if translatefpk returns an uncompressed key when converting to a Segwit descriptor. To prevent this panic, ensure translatefpk returns an error in this case instead.
type Output = Miniscript<Q, Ctx>
type Output = Miniscript<Q, Ctx>
The associated output type. This must be Self
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Eq for Miniscript<Pk, Ctx>
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.
Auto Trait Implementations
impl<Pk, Ctx> RefUnwindSafe for Miniscript<Pk, Ctx> where
Ctx: RefUnwindSafe,
Pk: RefUnwindSafe,
<Pk as MiniscriptKey>::Hash: RefUnwindSafe,
impl<Pk, Ctx> Send for Miniscript<Pk, Ctx> where
Ctx: Send + Sync,
Pk: Send + Sync,
<Pk as MiniscriptKey>::Hash: Send + Sync,
impl<Pk, Ctx> Sync for Miniscript<Pk, Ctx> where
Ctx: Send + Sync,
Pk: Send + Sync,
<Pk as MiniscriptKey>::Hash: Send + Sync,
impl<Pk, Ctx> Unpin for Miniscript<Pk, Ctx> where
Ctx: Unpin,
Pk: Unpin,
<Pk as MiniscriptKey>::Hash: Unpin,
impl<Pk, Ctx> UnwindSafe for Miniscript<Pk, Ctx> where
Ctx: UnwindSafe + RefUnwindSafe,
Pk: UnwindSafe + RefUnwindSafe,
<Pk as MiniscriptKey>::Hash: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<P, Q, T> TranslatePk1<P, Q> for T where
P: MiniscriptKey,
Q: MiniscriptKey<Hash = <P as MiniscriptKey>::Hash>,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk1<P, Q> for T where
P: MiniscriptKey,
Q: MiniscriptKey<Hash = <P as MiniscriptKey>::Hash>,
T: TranslatePk<P, Q>,
sourcefn translate_pk1<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
fn translate_pk1<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk1_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk1_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourceimpl<P, Q, T> TranslatePk2<P, Q> for T where
P: MiniscriptKey<Hash = P>,
Q: MiniscriptKey,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk2<P, Q> for T where
P: MiniscriptKey<Hash = P>,
Q: MiniscriptKey,
T: TranslatePk<P, Q>,
sourcefn translate_pk2<Fpk: Fn(&P) -> Result<Q, E>, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E>
fn translate_pk2<Fpk: Fn(&P) -> Result<Q, E>, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E>
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk2_infallible<Fpk: Fn(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk2_infallible<Fpk: Fn(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourceimpl<P, Q, T> TranslatePk3<P, Q> for T where
P: MiniscriptKey + ToPublicKey,
Q: MiniscriptKey<Hash = Hash>,
T: TranslatePk<P, Q>,
impl<P, Q, T> TranslatePk3<P, Q> for T where
P: MiniscriptKey + ToPublicKey,
Q: MiniscriptKey<Hash = Hash>,
T: TranslatePk<P, Q>,
sourcefn translate_pk3<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
fn translate_pk3<Fpk, E>(
&self,
translatefpk: Fpk
) -> Result<<Self as TranslatePk<P, Q>>::Output, E> where
Fpk: FnMut(&P) -> Result<Q, E>,
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more
sourcefn translate_pk3_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
fn translate_pk3_infallible<Fpk: FnMut(&P) -> Q>(
&self,
translatefpk: Fpk
) -> <Self as TranslatePk<P, Q>>::Output
Translate a struct from one generic to another where the translation for Pk is provided by translatefpk Read more