Trait miniscript::Translator
source · pub trait Translator<P, Q, E>where
P: MiniscriptKey,
Q: MiniscriptKey,{
// 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§
sourcefn sha256(&mut self, sha256: &P::Sha256) -> Result<Q::Sha256, E>
fn sha256(&mut self, sha256: &P::Sha256) -> Result<Q::Sha256, E>
Provides the translation from P::Sha256 -> Q::Sha256
sourcefn hash256(&mut self, hash256: &P::Hash256) -> Result<Q::Hash256, E>
fn hash256(&mut self, hash256: &P::Hash256) -> Result<Q::Hash256, E>
Provides the translation from P::Hash256 -> Q::Hash256