Trait elements_miniscript::TranslatePk[][src]

pub trait TranslatePk<P, Q> where
    P: MiniscriptKey,
    Q: MiniscriptKey
{ type Output; fn translate_pk<Fpk, Fpkh, E>(
        &self,
        translatefpk: Fpk,
        translatefpkh: Fpkh
    ) -> Result<Self::Output, E>
    where
        Fpk: FnMut(&P) -> Result<Q, E>,
        Fpkh: FnMut(&<P as MiniscriptKey>::Hash) -> Result<<Q as MiniscriptKey>::Hash, E>
; fn translate_pk_infallible<Fpk, Fpkh>(
        &self,
        translatefpk: Fpk,
        translatefpkh: Fpkh
    ) -> Self::Output
    where
        Fpk: FnMut(&P) -> Q,
        Fpkh: FnMut(&<P as MiniscriptKey>::Hash) -> <Q as MiniscriptKey>::Hash
, { ... } }
Expand description

Convert a descriptor using abstract keys to one using specific keys 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.

Associated Types

The associated output type. This must be Self

Required methods

Translate a struct from one Generic to another where the translation for Pk is provided by translatefpk, and translation for PkH is provided by translatefpkh

Provided methods

Calls translate_pk with conversion functions that cannot fail

Implementations on Foreign Types

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.

Convert a descriptor using abstract keys to one using specific keys 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.

Convert an AST element with one public key type to one of another public key type .This will panic while converting to Segwit Miniscript using uncompressed public keys

Implementors