TranslatePk1

Trait TranslatePk1 

Source
pub trait TranslatePk1<P: MiniscriptKey, Q: MiniscriptKey<Hash = P::Hash>>: TranslatePk<P, Q> {
    // Provided methods
    fn 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_infallible<Fpk: FnMut(&P) -> Q>(
        &self,
        translatefpk: Fpk,
    ) -> <Self as TranslatePk<P, Q>>::Output { ... }
}
Expand description

Variant of TranslatePk where P and Q both have the same hash type, and the hashes can be converted by just cloning them

Provided Methods§

Source

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

Source

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

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.

Implementors§

Source§

impl<P: MiniscriptKey, Q: MiniscriptKey<Hash = P::Hash>, T: TranslatePk<P, Q>> TranslatePk1<P, Q> for T