bpstd

Trait Descriptor

Source
pub trait Descriptor<K = XpubDerivable, V = ()>:
    DeriveScripts
    + Clone
    + Display {
    // Required methods
    fn class(&self) -> SpkClass;
    fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>
       where K: 'a;
    fn vars<'a>(&'a self) -> impl Iterator<Item = &'a V>
       where V: 'a;
    fn xpubs(&self) -> impl Iterator<Item = &XpubAccount>;
    fn legacy_keyset(&self, terminal: Terminal) -> IndexMap<LegacyPk, KeyOrigin>;
    fn xonly_keyset(
        &self,
        terminal: Terminal,
    ) -> IndexMap<XOnlyPk, TapDerivation>;
    fn legacy_witness(
        &self,
        keysigs: HashMap<&KeyOrigin, LegacyKeySig>,
    ) -> Option<(SigScript, Witness)>;
    fn taproot_witness(
        &self,
        keysigs: HashMap<&KeyOrigin, TaprootKeySig>,
    ) -> Option<Witness>;

    // Provided method
    fn is_taproot(&self) -> bool { ... }
}

Required Methods§

Source

fn class(&self) -> SpkClass

Source

fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>
where K: 'a,

Source

fn vars<'a>(&'a self) -> impl Iterator<Item = &'a V>
where V: 'a,

Source

fn xpubs(&self) -> impl Iterator<Item = &XpubAccount>

Source

fn legacy_keyset(&self, terminal: Terminal) -> IndexMap<LegacyPk, KeyOrigin>

Source

fn xonly_keyset(&self, terminal: Terminal) -> IndexMap<XOnlyPk, TapDerivation>

Source

fn legacy_witness( &self, keysigs: HashMap<&KeyOrigin, LegacyKeySig>, ) -> Option<(SigScript, Witness)>

Source

fn taproot_witness( &self, keysigs: HashMap<&KeyOrigin, TaprootKeySig>, ) -> Option<Witness>

Provided Methods§

Source

fn is_taproot(&self) -> bool

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<K> Descriptor<K> for StdDescr<K>
where K: DeriveSet<Compr = K, XOnly = K> + DeriveCompr + DeriveXOnly, StdDescr<K>: Derive<DerivedScript>,

Source§

impl<K> Descriptor<K> for Tr<K>
where K: DeriveXOnly,

Source§

impl<K> Descriptor<K> for TrKey<K>
where K: DeriveXOnly,

Source§

impl<K> Descriptor<K> for Wpkh<K>
where K: DeriveCompr,