[][src]Trait bdk::database::BatchOperations

pub trait BatchOperations {
    fn set_script_pubkey(
        &mut self,
        script: &Script,
        script_type: ScriptType,
        child: u32
    ) -> Result<(), Error>;
fn set_utxo(&mut self, utxo: &UTXO) -> Result<(), Error>;
fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>;
fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>;
fn set_last_index(
        &mut self,
        script_type: ScriptType,
        value: u32
    ) -> Result<(), Error>;
fn del_script_pubkey_from_path(
        &mut self,
        script_type: ScriptType,
        child: u32
    ) -> Result<Option<Script>, Error>;
fn del_path_from_script_pubkey(
        &mut self,
        script: &Script
    ) -> Result<Option<(ScriptType, u32)>, Error>;
fn del_utxo(&mut self, outpoint: &OutPoint) -> Result<Option<UTXO>, Error>;
fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>;
fn del_tx(
        &mut self,
        txid: &Txid,
        include_raw: bool
    ) -> Result<Option<TransactionDetails>, Error>;
fn del_last_index(
        &mut self,
        script_type: ScriptType
    ) -> Result<Option<u32>, Error>; }

Trait for operations that can be batched

This trait defines the list of operations that must be implemented on the Database type and the BatchDatabase::Batch type.

Required methods

fn set_script_pubkey(
    &mut self,
    script: &Script,
    script_type: ScriptType,
    child: u32
) -> Result<(), Error>

Store a script_pubkey along with its script type and child number

fn set_utxo(&mut self, utxo: &UTXO) -> Result<(), Error>

Store a UTXO

fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>

Store a raw transaction

fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>

Store the metadata of a transaction

fn set_last_index(
    &mut self,
    script_type: ScriptType,
    value: u32
) -> Result<(), Error>

Store the last derivation index for a given script type

fn del_script_pubkey_from_path(
    &mut self,
    script_type: ScriptType,
    child: u32
) -> Result<Option<Script>, Error>

Delete a script_pubkey given the script type and its child number

fn del_path_from_script_pubkey(
    &mut self,
    script: &Script
) -> Result<Option<(ScriptType, u32)>, Error>

Delete the data related to a specific script_pubkey, meaning the script type and the child number

fn del_utxo(&mut self, outpoint: &OutPoint) -> Result<Option<UTXO>, Error>

Delete a UTXO given its [OutPoint]

fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>

Delete a raw transaction given its [Txid]

fn del_tx(
    &mut self,
    txid: &Txid,
    include_raw: bool
) -> Result<Option<TransactionDetails>, Error>

Delete the metadata of a transaction and optionally the raw transaction itself

fn del_last_index(
    &mut self,
    script_type: ScriptType
) -> Result<Option<u32>, Error>

Delete the last derivation index for a script type

Loading content...

Implementations on Foreign Types

impl BatchOperations for Tree[src]

impl BatchOperations for Batch[src]

Loading content...

Implementors

impl BatchOperations for MemoryDatabase[src]

Loading content...