Trait psbt::KeyMap

source ·
pub trait KeyMap: Sized {
    type Keys: KeyType;

    const PROPRIETARY_TYPE: Self::Keys;

    // Required methods
    fn retrieve_key_pair<'enc>(
        &'enc self,
        version: PsbtVer,
        key_type: Self::Keys
    ) -> Vec<KeyPair<Self::Keys, Box<dyn Encode + 'enc>, Box<dyn Encode + 'enc>>>;
    fn insert_singular(
        &mut self,
        key_type: Self::Keys,
        value_data: ValueData
    ) -> Result<(), PsbtError>;
    fn insert_plural(
        &mut self,
        key_type: Self::Keys,
        key_data: KeyData,
        value_data: ValueData
    ) -> Result<(), PsbtError>;

    // Provided methods
    fn encode_map(
        &self,
        version: PsbtVer,
        writer: &mut dyn Write
    ) -> Result<usize, IoError> { ... }
    fn parse_map(
        &mut self,
        version: PsbtVer,
        map: Map<Self::Keys>
    ) -> Result<(), PsbtError> { ... }
    fn has_proprietary(&self, key: &PropKey) -> bool { ... }
    fn proprietary(&self, key: &PropKey) -> Option<&ValueData> { ... }
    fn proprietary_mut(&mut self, key: &PropKey) -> Option<&mut ValueData> { ... }
    fn push_proprietary(
        &mut self,
        key: PropKey,
        value: impl Into<ValueData>
    ) -> Result<(), KeyAlreadyPresent> { ... }
    fn remove_proprietary(&mut self, key: &PropKey) -> Option<ValueData> { ... }
    fn insert_proprietary(&mut self, prop_key: PropKey, value_data: ValueData) { ... }
    fn insert_unknown(
        &mut self,
        key_type: u8,
        key_data: KeyData,
        value_data: ValueData
    ) { ... }
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn retrieve_key_pair<'enc>( &'enc self, version: PsbtVer, key_type: Self::Keys ) -> Vec<KeyPair<Self::Keys, Box<dyn Encode + 'enc>, Box<dyn Encode + 'enc>>>

source

fn insert_singular( &mut self, key_type: Self::Keys, value_data: ValueData ) -> Result<(), PsbtError>

source

fn insert_plural( &mut self, key_type: Self::Keys, key_data: KeyData, value_data: ValueData ) -> Result<(), PsbtError>

Provided Methods§

source

fn encode_map( &self, version: PsbtVer, writer: &mut dyn Write ) -> Result<usize, IoError>

source

fn parse_map( &mut self, version: PsbtVer, map: Map<Self::Keys> ) -> Result<(), PsbtError>

source

fn has_proprietary(&self, key: &PropKey) -> bool

source

fn proprietary(&self, key: &PropKey) -> Option<&ValueData>

source

fn proprietary_mut(&mut self, key: &PropKey) -> Option<&mut ValueData>

source

fn push_proprietary( &mut self, key: PropKey, value: impl Into<ValueData> ) -> Result<(), KeyAlreadyPresent>

source

fn remove_proprietary(&mut self, key: &PropKey) -> Option<ValueData>

source

fn insert_proprietary(&mut self, prop_key: PropKey, value_data: ValueData)

source

fn insert_unknown( &mut self, key_type: u8, key_data: KeyData, value_data: ValueData )

Object Safety§

This trait is not object safe.

Implementors§

source§

impl KeyMap for Input

§

type Keys = InputKey

source§

const PROPRIETARY_TYPE: Self::Keys = InputKey::Proprietary

source§

impl KeyMap for Output

§

type Keys = OutputKey

source§

const PROPRIETARY_TYPE: Self::Keys = OutputKey::Proprietary

source§

impl KeyMap for Psbt

§

type Keys = GlobalKey

source§

const PROPRIETARY_TYPE: Self::Keys = GlobalKey::Proprietary