pub trait Translator<P, Q, E>{
    // Required methods
    fn pk(&mut self, pk: &P) -> Result<Q, E>;
    fn sha256(&mut self, sha256: &P::Sha256) -> Result<Q::Sha256, E>;
    fn hash256(&mut self, hash256: &P::Hash256) -> Result<Q::Hash256, E>;
    fn ripemd160(&mut self, ripemd160: &P::Ripemd160) -> Result<Q::Ripemd160, E>;
    fn hash160(&mut self, hash160: &P::Hash160) -> Result<Q::Hash160, E>;
}
Expand description

Describes an object that can translate various keys and hashes from one key to the type associated with the other key. Used by the TranslatePk trait to do the actual translations.

Required Methods§

source

fn pk(&mut self, pk: &P) -> Result<Q, E>

Translates public keys P -> Q.

source

fn sha256(&mut self, sha256: &P::Sha256) -> Result<Q::Sha256, E>

Provides the translation from P::Sha256 -> Q::Sha256

source

fn hash256(&mut self, hash256: &P::Hash256) -> Result<Q::Hash256, E>

Provides the translation from P::Hash256 -> Q::Hash256

source

fn ripemd160(&mut self, ripemd160: &P::Ripemd160) -> Result<Q::Ripemd160, E>

Translates ripemd160 hashes from P::Ripemd160 -> Q::Ripemd160

source

fn hash160(&mut self, hash160: &P::Hash160) -> Result<Q::Hash160, E>

Translates hash160 hashes from P::Hash160 -> Q::Hash160

Implementors§